home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tasm.arc / TASM.DOC < prev    next >
Encoding:
Text File  |  1987-10-31  |  124.0 KB  |  3,061 lines

  1.  
  2.       
  3.       
  4.       
  5.       
  6.       
  7.       
  8.       
  9.       
  10.       
  11.       
  12.       
  13.       
  14.                                TASM USER'S MANUAL
  15.       
  16.       
  17.         TASM - A Table Driven Cross Assembler for the MSDOS* Environment
  18.       
  19.       
  20.       
  21.       
  22.       
  23.       
  24.       
  25.       
  26.       
  27.                                Thomas N. Anderson
  28.                          Speech Technology Incorporated
  29.                               16321 176th Avenue NE
  30.                              Woodinville, WA   98072
  31.       
  32.                                    March, 1986
  33.                                    Version 2.2
  34.       
  35.       [Speech Technology Incorporated  is  a  manufacturer  of  electronic
  36.       devices  to  aid  the visually impaired,  generally employing speech
  37.       synthesis technology.]
  38.       
  39.       
  40.       
  41.       (C) Copyright 1985,  1986 by  Speech  Technology  Incorporated.  All 
  42.       rights  reserved.  Permission  is  granted to copy this document and 
  43.       related software.  
  44.       
  45.       
  46.       If you are dissatisfied with the product for any reason,  return the
  47.       original  merchandise (disk and manual) within 90 days to seller for
  48.       a full refund of any amounts paid.
  49.       
  50.       
  51.       
  52.       
  53.       
  54.       
  55.       
  56.        * MSDOS is a trademark of Microsoft Corporation.
  57.       
  58.       
  59.       
  60.       
  61.  
  62.       TASM - Table Driven Assembler                                Page 2    
  63.       
  64.       
  65.       TABLE OF CONTENTS
  66.       
  67.       
  68.       
  69.       
  70.       
  71.       
  72.       
  73.       
  74.       
  75.       
  76.               SECTION                                        PAGE
  77.               ____________________________________________________
  78.               INTRODUCTION....................................3
  79.               INVOCATION......................................4
  80.               SOURCE FORMAT...................................7
  81.               EXPRESSIONS.....................................9
  82.               ASSEMBLER DIRECTIVES............................12
  83.               OBJECT FILE FORMATS.............................18
  84.               LISTING FILE FORMAT.............................20
  85.               PROM PROGRAMMING................................21
  86.               ERROR MESSAGES..................................23
  87.               BUGS AND LIMITATIONS............................25
  88.               6502 INSTRUCTIONS AND ADDRESSING MODES..........26
  89.               8048 INSTRUCTIONS AND ADDRESSING MODES..........29
  90.               8051 INSTRUCTIONS AND ADDRESSING MODES..........33
  91.               TASM DISTRIBUTION FILES.........................37
  92.               PORTING TASM TO OTHER ENVIRONMENTS..............38
  93.               TASM INSTRUCTION SET TABLE DEFINITION...........40
  94.               SUMMARY.........................................43
  95.       
  96.               APPENDIX A - SAMPLE LISTING FILE................44
  97.               APPENDIX B - SAMPLE INSTRUCTION SET TABLE ......46
  98.               APPENDIX C - ORDERING INFORMATION...............51
  99.       
  100.       
  101.       
  102.       
  103.       
  104.       
  105.       
  106.       
  107.       
  108.       
  109.       
  110.       
  111.       
  112.       
  113.       
  114.       
  115.       
  116.       
  117.       
  118.       
  119.       
  120.       
  121.  
  122.       TASM - Table Driven Assembler                                Page 3    
  123.       
  124.       
  125.       INTRODUCTION
  126.       
  127.       TASM is a set of  table  driven  cross  assemblers  for  the  MS-DOS
  128.       environment.  Currently  versions  for  the  6502,  8048,  and  8051
  129.       microprocessors are supported by STI,  but the user so inclined  may
  130.       build versions for other 8 bit microprocessors (see sections on TASM
  131.       DISTRIBUTION  FILES  and  TASM  INSTRUCTION SET TABLE DEFINITION for
  132.       notes on reconfiguring TASM for other processors).
  133.       
  134.       TASM characteristics include:
  135.       
  136.               1.  Powerful expression parsing (17 operators).
  137.       
  138.               2.  Supports a subset of the 'C' preprocessor commands.
  139.       
  140.               3.  Macro capability (through use of DEFINE directive).
  141.       
  142.               4.  Multiple statements per line.
  143.       
  144.               5.  Supports three object file formats (Intel Hex, MOS
  145.                       Technology Hex, and binary).
  146.       
  147.               6.  Absolute code generation only.
  148.       
  149.               7.  Source code available (in C).
  150.       
  151.               8.  Uniform syntax  across  versions  for  different  target
  152.                       machines.
  153.       
  154.               9.  Features in support  of  PROM  programming  (preset  all
  155.                       bytes  to  specified value,  output object code in a
  156.                       contiguous block).
  157.       
  158.               10.  Supports extended instructions of the Rockwell R65C02.
  159.       
  160.               11.  Tables  can  be  generated  for  other  microprocessors
  161.                       without having to modify the TASM executable module.
  162.       
  163.       
  164.       
  165.       
  166.       
  167.       
  168.       
  169.       
  170.       
  171.       
  172.       
  173.       
  174.       
  175.       
  176.       
  177.       
  178.       
  179.       
  180.       
  181.  
  182.       TASM - Table Driven Assembler                                Page 4    
  183.       
  184.       
  185.       INVOCATION
  186.       
  187.       TASM can be invoked as  follows  (optional fields shown in brackets,
  188.       symbolic fields enclosed in <>):
  189.       
  190.           tasm -<pn> [-bcfhlmpxdo] source_file [object_file [list_file]]
  191.       
  192.           Where the option flags are defined as follows:
  193.       
  194.               -<pn>           Specify version (<pn> = part number)
  195.               -c              object file written as a contiguous block
  196.               -f<xx>          Fill entire memory space with <xx> (hex)
  197.               -h              Produce hex table of the assembled code
  198.               -l              Produce a label table in the listing
  199.               -m              Produce object in MOS Technology format
  200.               -b              Produce object in binary (.COM) format
  201.               -p              Page the listing file
  202.               -q              Quite, disable the listing file
  203.               -x[<m>]         Enable extended instruction set (if any)
  204.               -d<macro>       Define a macro (or just a macro label)
  205.               -o<bb>          Bytes per object record (hex)
  206.       
  207.       TASM has no built in instruction set tables,  and so  it  must  read
  208.       them  at  run time.  TASM determines which table to use based on the
  209.       '-<pn>' field shown above.  For example,  to assemble the code in  a
  210.       file called 'source.asm' one would enter:
  211.       
  212.               tasm -48  source.asm            for an 8048 assembly
  213.               tasm -65  source.asm            for a  6502 assembly
  214.               tasm -51  source.asm            for a  8051 assembly.
  215.       
  216.       The file name that the tables are read from is formed by taking  the
  217.       digits  specified  after  the  '-'  and  appending it to 'TASM' then
  218.       appending the '.TAB' extension.  Thus,  the '-48' flag  would  cause
  219.       the  tables  to  be  read from the file 'TASM48.TAB' (See section on
  220.       TASM INSTRUCTION SET DEFINITION).
  221.       
  222.       The  source file must be specified.  If not,  some usage information
  223.       is displayed.  If the object file is not specified then  the  object
  224.       filename  is  formed  by taking the source filename and changing the
  225.       extension  to  '.OBJ'.  Similarly,  if  the  list  filename  is  not
  226.       specified  it is formed by changing the source filename extension to
  227.       '.LST'.
  228.       
  229.       Each option flag must be  preceded  by  a  dash.  Options  need  not
  230.       precede  the filenames,  however.  The various options are described
  231.       below:
  232.       
  233.       c - Contiguous Block Output. If this option is specified,  then  all
  234.       bytes  in the range from the lowest used byte to the highest will be
  235.       defined in the object file.  Normally,  with the default  Intel  Hex
  236.       object  format  enabled,  if  the Program Counter (PC) jumps forward
  237.       because of an .ORG directive,  the bytes skipped over will not  have
  238.       any  value  assigned  them  in  the  object  file.  With this option
  239.       enabled,  no output to the object file occurs until the end  of  the
  240.       assembly  at  which time the whole block is written.  This is useful
  241.  
  242.       TASM - Table Driven Assembler                                Page 5    
  243.       
  244.       when using TASM to generate code that will be put  into  a  PROM  so
  245.       that  all  locations  will have a known value.  This option is often
  246.       used in conjunction with the -f option to ensure  all  unused  bytes
  247.       will have a known value.
  248.       
  249.       f  -  Fill  Memory.  This  option  causes the memory image that TASM
  250.       maintains to be initialized to the value specified by  the  two  hex
  251.       characters  immediately  following the 'f'.  TASM maintains a memory
  252.       image that is a full 64K bytes in size (even if the target processor
  253.       cannot  utilize  that  memory  space).  Invocation  of  this  option
  254.       introduces a 2 second delay at start up (time required to initialize
  255.       all 64K bytes).   See Appendix A for an example.
  256.       
  257.       h - Hex Table. This option causes a hex table of the produced object
  258.       code to appear in the listing file.  Each line of  the  table  shows
  259.       sixteen bytes of code.  The format is shown in the sample listing in
  260.       Appendix A.
  261.       
  262.       l - Label Table. This option causes a label table to appear  in  the
  263.       listing  file.  Each  label is  shown  with its corresponding value.
  264.       Macro labels (as established  via  the  DEFINE  directives)  do  not
  265.       appear.  The format is shown in the sample listing in Appendix A.
  266.       
  267.       m - MOS Technology Object Format. This option causes the object file
  268.       to be written in MOS Technology hex format rather than  the  default
  269.       Intel  hex  format.  See  section  on  OBJECT  FILE  FORMATS  for  a
  270.       description of the format.
  271.       
  272.       b  -  Binary Object Format. This option causes the object file to be
  273.       written in binary - one byte for each byte of code/data.  Note  that
  274.       no  address  information  is  included  in  the  object file in this
  275.       format.  The contiguous block (-c) output mode is forced  when  this
  276.       option is invoked.
  277.       
  278.       p - Page Listing File.  This option causes the listing file to  have 
  279.       top of page headers and form feeds inserted at appropriate intervals 
  280.       (every sixty lines of output).  
  281.       
  282.       q - Disable Listing File.  This option  causes  all  output  to  the 
  283.       listing  file  to  be  suppressed,   unless  a  .LIST  directive  is 
  284.       encountered in the source file (see LIST/NOLIST directives).  
  285.       
  286.       x - Enable Extended Instruction  Set.  If  a  processor  family  has
  287.       instructions  that  are valid for only certain members,  this option
  288.       can be used to enable those beyond the  basic  standard  instruction
  289.       set.  Presently,  this  option  only  has  significance for the 6502
  290.       version (TASM -65) which has extended instructions for the  Rockwell
  291.       R65C02  and  the  R65C00/21.  A  hex  digit  may  follow  the 'x' to
  292.       indicate a mask value used in selecting the appropriate  instruction
  293.       set.  Bit  0  of the mask selects the basic instruction set,  thus a
  294.       '-x1' would have no effect.  A '-x3' would enable the basic set plus
  295.       whatever instructions have bit 1 set in their  class  mask.  A  '-x'
  296.       without  a  digit  following is equivalent to a '-xf' which sets all
  297.       four of the  mask  bits.  (See  section  on  6502  INSTRUCTIONS  AND
  298.       ADDRESSING MODES for details on its extended instructions).
  299.       
  300.       
  301.  
  302.       TASM - Table Driven Assembler                                Page 6    
  303.       
  304.       d - Define a Macro. Macros  are  be  defined  on  the  command  line
  305.       generally to control the assembly of various IFDEF's that are in the
  306.       source  file.  This is a convenient way to generate various versions
  307.       of object code from a single source file.
  308.       
  309.       o - Set Number of Bytes per Object Record.  When  generating  object
  310.       code in either the MOS Technology format or the Intel hex format,  a
  311.       default of 24 (decimal) bytes of object are defined on each  record.
  312.       This can be altered by invoking the '-o' option immediately followed
  313.       by  two  hex digits defining the number of bytes per record desired.
  314.       For example,  if 32 bytes per record are desired,  one might  invoke
  315.       TASM as:
  316.       
  317.               TASM -48 -o20 source.asm
  318.       
  319.       
  320.       
  321.       
  322.       
  323.       
  324.       
  325.       
  326.       
  327.       
  328.       
  329.       
  330.       
  331.       
  332.       
  333.       
  334.       
  335.       
  336.       
  337.       
  338.       
  339.       
  340.       
  341.       
  342.       
  343.       
  344.       
  345.       
  346.       
  347.       
  348.       
  349.       
  350.       
  351.       
  352.       
  353.       
  354.       
  355.       
  356.       
  357.       
  358.       
  359.       
  360.       
  361.  
  362.       TASM - Table Driven Assembler                                Page 7    
  363.       
  364.       
  365.       SOURCE FORMAT
  366.       
  367.       Statements in the source file must conform to a  format  as  follows
  368.       (except  for assembler directive statements which are described in a
  369.       subsequent section):
  370.       
  371.               <label>  <operation>    <operand>       <comment>
  372.       
  373.       All of the fields are optional, under appropriate circumstances.  An
  374.       arbitrary amount of white space (space and tabs) can  separate  each
  375.       field  (as  long as the maximum line length of 255 characters is not
  376.       exceeded).  Each of fields are described below:
  377.       
  378.       
  379.       Label Field. If the first character of the line is alphabetic, it is
  380.       assumed  to  be  the  start  of  a label.  Subsequent characters are
  381.       accepted as part of that  label  until  a  space,  tab,  or  ':'  is
  382.       encountered.   The   assembler   assigns   a   value  to  the  label
  383.       corresponding to the current  location  counter.  Labels  can  be  a
  384.       maximum  of  13 characters long.  Labels can contain upper and lower
  385.       case letters, digits, underscores,  and periods (the first character
  386.       must  be alphabetic).  Labels are case sensitive - the label 'START'
  387.       is a different label from 'start'.
  388.       
  389.       Operation  Field.  The  operation  field  contains  an   instruction
  390.       (opcode)  mnemonic  which  specifies the action to be carried out by
  391.       the  target  processor  when  this  instruction  is  executed.   The
  392.       interpretation  of each mnemonic is dependent on the version of TASM
  393.       being used (see  section  on  OPCODES  AND  ADDRESSING  MODES).  The
  394.       operation  field  may  begin  in  any  column except the first.  The
  395.       operation field is case insensitive.
  396.       
  397.       Operand Field. The operand field specifies the data to  be  operated
  398.       on  by  the  instruction.  It may include expressions and/or special
  399.       symbols describing the  addressing  mode  to  be  used.  The  actual
  400.       format and interpretation is dependent on the target processor.  For
  401.       a description of the format for currently supported processors,  see
  402.       the section on OPCODES AND ADDRESSING MODES  for  the  processor  of
  403.       interest.
  404.       
  405.       Comment  Field.  The  comment  field always begins with a semicolon.
  406.       The rest of the line from the semicolon to the end of  the  line  is
  407.       ignored  by  TASM,  but passed on to the listing file for annotation
  408.       purposes.  The comment field must be the last field on a  line,  but
  409.       it may be the only field, starting in column one, if desired.
  410.       
  411.       Multiple  Statement Lines. If the backslash character is encountered
  412.       on a source line,  it is treated as a newline.  The remainder of the
  413.       line  following  the  backslash  will be processed as an independent
  414.       line of source code.  This allows one to put multiple statements  on
  415.       a line.  This facility is not so useful of itself,  but when coupled
  416.       with the capability  of  the  DEFINE  directive,  powerful  multiple
  417.       statement  macros  can  be  constructed  (see  section  on ASSEMBLER
  418.       DIRECTIVES).  Note that when  using  the  statement  separator,  the
  419.       character  immediately  following  it should be considered the first
  420.       character of a new line,  and thus must either be a start of a label
  421.  
  422.       TASM - Table Driven Assembler                                Page 8    
  423.       
  424.       or  white space (not an instruction).  As the examples show, a space
  425.       is put between the backslash and the start of the next instruction.
  426.       
  427.       
  428.       
  429.       
  430.       Some  examples  of  valid  source  statements follow (6502 mnemonics
  431.       shown):
  432.       
  433.       label1  lda     byte1   ;get the first byte
  434.               dec     byte1
  435.               jne     label1
  436.       
  437.       ;
  438.       label2
  439.               sta     byte2,X
  440.               ; a multiple statement line follows
  441.               lda     byte1\ sta byte1+4\ lda byte2\ sta byte2+4
  442.       
  443.       
  444.       
  445.       
  446.       
  447.       
  448.       
  449.       
  450.       
  451.       
  452.       
  453.       
  454.       
  455.       
  456.       
  457.       
  458.       
  459.       
  460.       
  461.       
  462.       
  463.       
  464.       
  465.       
  466.       
  467.       
  468.       
  469.       
  470.       
  471.       
  472.       
  473.       
  474.       
  475.       
  476.       
  477.       
  478.       
  479.       
  480.       
  481.  
  482.       TASM - Table Driven Assembler                                Page 9    
  483.       
  484.       
  485.       EXPRESSIONS
  486.       
  487.       Expressions are made  up  of  various  syntactic  elements  (tokens)
  488.       combined  according  to  a set of syntactical rules.  The tokens are
  489.       summarized as follows:
  490.       
  491.               1.  Labels
  492.               2.  Constants
  493.               3.  Location Counter Symbol
  494.               4.  Operators
  495.               5.  Parenthesis
  496.       
  497.       Labels. Labels are strings of characters that have a  numeric  value
  498.       associated with them, generally representing an address.  Labels can
  499.       contain  upper  and  lower case letters,  digits,  underscores,  and
  500.       periods.  The first character must be a letter  (to  distinguish  it
  501.       from a numeric constant).  The value of a label is limited to 16 bit
  502.       precision.  Labels can contain up to 13 characters, all of which are
  503.       significant (none are ignored when looking at a labels value,  as in
  504.       some assemblers).
  505.       
  506.       Constants.  Numeric constants must always begin with a decimal digit
  507.       (thus hexadecimal  constants  that  start  with  a  letter  must  be
  508.       prefixed by a '0').  The radix is determined by a letter immediately
  509.       following the digit string according to the following table:
  510.       
  511.               Radix           Suffix                  Prefix
  512.               ---------------------------------------------------
  513.               2               B or b                    %
  514.               8               O or o                    @
  515.               10              D or d (or nothing)
  516.               16              H or h                    $
  517.       
  518.       Decimal is the default radix, so decimal constants need no suffix or
  519.       prefix.
  520.       
  521.       The following representations are equivalent:
  522.       
  523.               1234H           or      $1234
  524.               100d            or      100
  525.               177400O         or      @177400
  526.               01011000b       or      %01011000
  527.       
  528.       The  prefixes  are provided for compatibility with some other source
  529.       code formats but introduce a problem of ambiguity.  Both '%' and '$'
  530.       have alternate uses  ('%'  for  modulo,  '$'  for  location  counter
  531.       symbol).  To  resolve this,  some simple rules are employed.  If the
  532.       first character following a '%' is a '0' or '1', it is assumed to be
  533.       a radix specifier and not the modulo  operator.  Similarly,  if  the
  534.       first character following a '$' is a valid hexadecimal digit,  it is
  535.       assumed to be a radix specifier and not the location  counter.  This
  536.       can  cause problems,  however.  Suppose you wanted to find the value
  537.       of the low byte of the label 'PNTR_TABLE', you might do this:
  538.       
  539.               (PNTR_TABLE%0100h)
  540.       
  541.  
  542.       TASM - Table Driven Assembler                                Page 10  
  543.       
  544.       Here the '%' would mistakenly be taken for  a  radix  specifier.  To
  545.       correct  the  problem one need only insert a space in an appropriate
  546.       spot:
  547.       
  548.               (PNTR_TABLE % 0100h)
  549.       
  550.       Character  constants  are  single  characters  surrounded  by single
  551.       quotes (following  quote  is  optional).  The  ASCII  value  of  the
  552.       character  in the quotes is returned.  No escape provision exists to
  553.       represent non-printable characters within the quotes,  but  this  is
  554.       not  necessary  since  these  can  be  just as easily represented as
  555.       numeric constants.
  556.       
  557.       String constants are one or more  characters  surrounded  by  double
  558.       quotes.  Note  that string constants are not allowed in expressions.
  559.       They are only allowable following the 'TITLE' and  'TEXT'  assembler
  560.       directives.
  561.       
  562.       Location  Counter  Symbol. The current value of the location counter
  563.       (PC) can be used in expressions by placing  a  '$'  in  the  desired
  564.       place.  The  Location Counter Symbol is allowable anywhere a numeric
  565.       constant is.  (Note that if the '$' is followed by a  decimal  digit
  566.       then  it  is  taken to be the hexadecimal radix indicator instead of
  567.       the Location Counter symbol,  as mentioned above).  The '*' may also
  568.       be  used  to  represent the location counter,  but is less preferred
  569.       because of its ambiguity with the multiplicative operator.
  570.       
  571.       Operators. Expressions can optionally contain operators  to  perform
  572.       some   alterations   or  calculations  on  particular  values.   The
  573.       operators are summarized as follows:
  574.       
  575.               Operator  Type          Description
  576.               __________________________________________
  577.               +        Additive       addition
  578.               -                       subtraction
  579.       
  580.               *        Multiplicative multiplication
  581.               /                       division
  582.               %                       modulo
  583.               <<                      logical shift left
  584.               >>                      logical shift right
  585.       
  586.               ~        Unary          bit inversion (one's complement)
  587.               -                       unary negation
  588.       
  589.               =        Relational     equal
  590.               ==                      equal
  591.               !=                      not equal
  592.               <                       less than
  593.               >                       greater than
  594.               <=                      less than or equal
  595.               >=                      greater than or equal
  596.       
  597.               &       Binary          binary 'and'
  598.               |                       binary 'or'
  599.               ^                       binary 'exclusive or'
  600.       
  601.  
  602.       TASM - Table Driven Assembler                                Page 11  
  603.       
  604.       The syntax is much the same as in 'C' with the following notes:
  605.       
  606.               1.  No operator precedence is in effect.  Evaluation is from
  607.                       left to right unless grouped by  parenthesis  (  see
  608.                       example below).
  609.       
  610.               2.  All evaluations are done with 16 bit precision.
  611.       
  612.               3.  Both '=' and '==' are allowable equality checkers.  This
  613.                       is allowed   since   the  syntax  does  not  provide
  614.                       assignment capability (as '=' would normally be used
  615.                       for).
  616.       
  617.       The relational operators return a value of 1 if the relation is true
  618.       and 0 if it is false.  Sixteen bit signed arithmetic is used.
  619.       
  620.       It is always a good idea to explicitly indicate the desired order of
  621.       evaluation with  parenthesis,  especially  to  maintain  portability
  622.       since  TASM does not evaluate expressions in the same manner as many
  623.       other assemblers.  To understand how it does arrive  at  the  values
  624.       for expressions, consider the following example:
  625.       
  626.               1 + 2*3 + 4
  627.       
  628.       TASM would start at the left and read the first token '1'  and  then
  629.       the  operator  '+'.  To  determine  what  to  add  to  the '1',  the
  630.       expression evaluator would be called recursively on the remainder of
  631.       the expression.  The next pass would read the '2' and '*'  and  then
  632.       call  itself again to evaluate the rest.  Another level of recursion
  633.       would take place in evaluating the '4'.  Since it is not followed by
  634.       any more operators, the recursion would start undoing itself and the
  635.       final expression would be evaluated as:
  636.       
  637.               1 + (2 * (3 + (4))) = 15
  638.       
  639.       If the user had desired the '*' to take precedence, the following
  640.       could have been done:
  641.       
  642.               1 + (2*3) + 4
  643.       
  644.       Use parenthesis liberally.
  645.       
  646.       Here are some examples of valid expressions:
  647.       
  648.               (0f800H + tab)
  649.               (label_2 >> 8)
  650.               (label_3 << 8) & $f000
  651.               $ + 4
  652.               010010000100100b + 'a'
  653.               (base + ((label_4 >> 5) & (mask << 2))
  654.       
  655.       
  656.       
  657.       
  658.       
  659.       
  660.       
  661.  
  662.       TASM - Table Driven Assembler                                Page 12  
  663.       
  664.       
  665.       ASSEMBLER DIRECTIVES
  666.       
  667.       Most of the assembler  directives  have  a  format  similar  to  the
  668.       machine   instruction   format.   However,   instead  of  specifying
  669.       operations for the processor to carry out,  the directives cause the
  670.       assembler  to perform some function related to the assembly process.
  671.       TASM has two types of assembler directives - those  that  mimic  the
  672.       'C'  preprocessor  functions,  and  those  that  resemble  the  more
  673.       traditional assembler directive functions.  Each of  these  will  be
  674.       discussed.
  675.       
  676.       The  'C' preprocessor style directives are are invoked with a '#' as
  677.       the  first  character  of  the  line  followed  by  the  appropriate
  678.       directive  (just  as in 'C').  Thus,  these directives cannot have a
  679.       label preceding  them (on the same line).  Note that in the examples
  680.       directives are shown in upper case,  however,  either upper or lower
  681.       case is acceptable.
  682.       
  683.       INCLUDE. The INCLUDE directive reads in and assembles the  indicated
  684.       source  file.  INCLUDEs can be nested up to six levels.  This allows
  685.       a convenient means to  keep  common  definitions,  declarations,  or
  686.       subroutines  in  files  to  be included as needed.  The format is as
  687.       follows:
  688.       
  689.               #INCLUDE        <filename>
  690.       
  691.       The  <filename>  must  be  enclosed in double quotes.  Here are some
  692.       examples:
  693.       
  694.               #INCLUDE        "macros.h"
  695.               #include "equates"
  696.               #include "subs.asm"
  697.       
  698.       
  699.       DEFINE.  The  DEFINE  directive  is  one of the most powerful of the
  700.       directives and allows string substitution  with  optional  arguments
  701.       (macros).  The format is as follows:
  702.       
  703.               #DEFINE  <macro_label>[(<arg_list>)]      [<macro_definition>]
  704.       
  705.               <macro_label> := character string to be expanded when found
  706.                                       in the source file.
  707.       
  708.               <arg_list>    := optional argument list for variable
  709.                                       substitution in macro expansion.
  710.       
  711.               <macro_def>   := character string to replace the occurrences
  712.                                       of <macro_label> in the source file.
  713.       
  714.       
  715.       
  716.       The simplest form of the DEFINE directive might look like this:
  717.       
  718.               #DEFINE         MLABEL
  719.       
  720.       Notice  that no substitutionary string is specified.  The purpose of
  721.  
  722.       TASM - Table Driven Assembler                                Page 13  
  723.       
  724.       a statement like this would typically be to define a label  for  the
  725.       purpose  of  controlling some subsequent conditional assembly (IFDEF
  726.       or IFNDEF).
  727.       
  728.       A more complicated example,  performing simple  substitution,  might
  729.       look like this:
  730.       
  731.               #DEFINE         VAR1_LO         (VAR1 & 255)
  732.       
  733.       This statement would cause all occurrences of the  string  'VAR1_LO'
  734.       in the source to be substituted with '(VAR1 & 255)'.
  735.       
  736.       As  a  more  complicated  example,   using  the  argument  expansion
  737.       capability, consider this:
  738.       
  739.               #DEFINE         ADD(xx,yy)      clc\ lda xx\ adc yy\ sta xx
  740.       
  741.       If the source file then contained a line like this:
  742.       
  743.               ADD(VARX,VARY)
  744.       
  745.       It would be expanded to:
  746.       
  747.               clc\ lda VARX\ adc VARY\ sta VARX
  748.       
  749.       The above example shows the use of the backslash ('\') character  as
  750.       a  multiple  instruction  statement delimiter.  This approach allows
  751.       the definition of fairly powerful,  multiple statement  macros.  The
  752.       example shown generates 6502 instructions to add one memory location
  753.       to another.
  754.       
  755.       Some rules associated with the argument list:
  756.       
  757.               1.  Use a maximum of 10 arguments.
  758.       
  759.               2.  An argument in the DEFINE statement  must  be  a  unique
  760.                       string  (unique  on  that line) occurring only as an
  761.                       argument  elsewhere  in  the  line.   TASM  does   a
  762.                       straight  forward  search  for the occurrence of the
  763.                       specified argument strings in  the  macro_definition
  764.                       field  and  if  the  string  is  found somewhere not
  765.                       intended,  bad things  will  happen.  In  the  above
  766.                       example,  if  a  simple '(a,b)' had been used as the
  767.                       argument list instead '(xx,yy)',  then each  'a'  in
  768.                       the  definition  would be expanded (e.g.  the 'a' in
  769.                       'lda').
  770.       
  771.               3.  Each argument should be a maximum of 15 characters.
  772.       
  773.       Note that macros can be defined on the TASM command line, also, with
  774.       the '-d' option flag.
  775.       
  776.       IFDEF.  This directive can be used to optionally assemble a block of
  777.       code.  It has the following form:
  778.       
  779.               #IFDEF  <macro_label>
  780.       
  781.  
  782.       TASM - Table Driven Assembler                                Page 14  
  783.       
  784.       When invoked,  the list of  macro  labels  (established  via  DEFINE
  785.       directives) is searched.  If the label is found, the following lines
  786.       of  code  are  assembled.  If  not found,  the input file is skipped
  787.       until an ENDIF or ELSE directive is found.
  788.       
  789.       Lines that are skipped over still appear in the listing file,  but a
  790.       '~'  will appear immediately after the current PC and no object code
  791.       will be generated (this is applicable to IFDEF, IFNDEF, and IF).
  792.       
  793.       IFNDEF. This directive is the opposite of the IFDEF  directive.  The
  794.       block   of  code  following  is  assembled  only  if  the  specified
  795.       macro_label is undefined.  It has the following form:
  796.       
  797.               #IFNDEF  <macro_label>
  798.       
  799.       When invoked,  the list of  macro  labels  (established  via  DEFINE
  800.       directives)  is searched.  If the label is not found,  the following
  801.       lines of code are assembled.  If it is  found,  the  input  file  is
  802.       skipped until an ENDIF or ELSE directive is found.
  803.       
  804.       IF.  This  directive  can  be used to optionally assemble a block of
  805.       code dependent on the value of a given expression.  The format is as
  806.       follows:
  807.       
  808.               #IF     <expr>
  809.       
  810.       If the expression <expr> evaluates to non-zero, the following block
  811.       of code is assembled (until an ENDIF or ELSE is encountered).
  812.       
  813.       
  814.       ENDIF. This directive must always follow an  IFDEF,  IFNDEF,  or  IF
  815.       directive and signifies the end of the conditional block.
  816.       
  817.       ELSE. This directive can optionally be used with IFDEF,  IFNDEF  and
  818.       IF  to  delineate  an alternate block of code to be assembled if the
  819.       block  immediately  following  the  IFDEF,   IFNDEF  or  IF  is  not
  820.       assembled.
  821.       
  822.       Here are some examples of the use of IFDEF, IFNDEF,  IF,  ELSE,  and
  823.       ENDIF:
  824.       
  825.               #IFDEF  label1
  826.               lda     byte1
  827.               sta     byte2
  828.               #ENDIF
  829.       
  830.               #ifdef  label1
  831.               lda     byte1
  832.               #else
  833.               lda     byte2
  834.               #endif
  835.       
  836.               #ifndef label1
  837.               lda     byte2
  838.               #else
  839.               lda     byte1
  840.               #endif
  841.  
  842.       TASM - Table Driven Assembler                                Page 15  
  843.       
  844.       
  845.               #if ($ >= 1000h)
  846.               ; generate an invalid statement to cause an error
  847.               ;  when we go over the 4K boundary.
  848.                !!! PROM bounds exceeded.
  849.               #endif
  850.       
  851.       ORG. This directive  provides  the  means  to  set  the  Instruction
  852.       Pointer  (a.k.a.  Program Counter) to the desired value.  The format
  853.       is:
  854.       
  855.               [<label>] .ORG    <expr>
  856.       
  857.       The <label> is optional.  The Instruction pointer  is  assigned  the
  858.       value  of  the  expression,  <expr>.  For example,  to generate code
  859.       starting at address 1000H, the following could be done:
  860.       
  861.               start   .ORG    1000H
  862.       
  863.       The expression  (<expr>)  may  contain  references  to  the  current
  864.       Instruction Pointer, thus allowing various manipulations to be done.
  865.       For  example,  to align the Instruction Pointer on the next 256 byte
  866.       boundary, the following could be done:
  867.       
  868.                       .ORG  (($ + FFH) & FF00H)
  869.       
  870.       ORG can also be used to reserve space without assigning values:
  871.       
  872.                       .ORG    $+8
  873.       
  874.       An alternate form of ORG is '*=' or '$='.  Thus  the  following  two
  875.       examples as exactly equivalent to the previous example:
  876.       
  877.                       *=*+8
  878.                       $=$+8
  879.       
  880.       EQU. This directive can be used to  assign  values  to  labels.  The
  881.       labels  can  then  be  used  in  expressions in place of the literal
  882.       constant.  The format is:
  883.       
  884.               <label> .EQU  <expr>
  885.       
  886.       Here is an example:
  887.       
  888.               MASK    .EQU    F0H
  889.               ;
  890.                       lda     IN_BYTE
  891.                       and     MASK
  892.                       sta     OUT_BYTE
  893.       
  894.       An  alternate  form  of  'EQU'  is  '='.  The  previous  example  is
  895.       equivalent to:
  896.       
  897.               MASK    =       F0H
  898.       or
  899.               MASK    =FOH
  900.               MASK    =$FO
  901.  
  902.       TASM - Table Driven Assembler                                Page 16  
  903.       
  904.       
  905.       White  space must exist after the label,  but none is required after
  906.       the '='.
  907.       
  908.       
  909.       BYTE.  This directive allows a value assignment to the byte pointed
  910.       to by the current Instruction Pointer.  The format is:
  911.       
  912.               [<label>] .BYTE   <expr>
  913.       
  914.       Only the lower eight bits of <expr> are used.  Only one byte at a
  915.       time may be assigned.  Here are some examples:
  916.       
  917.               label1  .BYTE   10010110B
  918.                       .byte   'a'
  919.                       .byte   0
  920.       
  921.       
  922.       WORD. This directive allows a value assignment to the next two bytes
  923.       pointed to by the current Instruction Pointer.  The format is:
  924.       
  925.               [<label>] .WORD  <expr>
  926.       
  927.       The  least  significant  byte  of  <expr>  is  put  at  the  current
  928.       Instruction  Pointer  with  the  most  significant  byte at the next
  929.       sequential location.  Here are some examples:
  930.       
  931.               data_table      .WORD   (data_table + 1)
  932.                               .word   $1234
  933.                               .Word   (('x' - 'a')  << 2)
  934.       
  935.       
  936.       TEXT.  This  directive  allows  an ASCII string to be used to assign
  937.       values  to  a  sequence  of  locations  starting  at   the   current
  938.       Instruction Pointer.  The format is:
  939.       
  940.               [<label>] .TEXT   "<string>"
  941.       
  942.       The  ASCII value of each character in <string> is taken and assigned
  943.       to the next sequential location.  Here are some examples:
  944.       
  945.               message1  .TEXT  "Disk I/O error"
  946.               message2  .text  "Enter file name "
  947.                         .text  "abcdefg"
  948.       
  949.       TASM  only  shows  the first four bytes of the string in the listing
  950.       file, but all bytes are included in the object file.
  951.       
  952.       BLOCK. This directive causes the Instruction Pointer to advance  the
  953.       specified  number  of  bytes without assigning values to the skipped
  954.       over locations.  The format is:
  955.       
  956.               [<label>] .BLOCK        <expr>
  957.       
  958.       Some valid examples are:
  959.       
  960.               word1   .BLOCK  2
  961.  
  962.       TASM - Table Driven Assembler                                Page 17  
  963.       
  964.               byte1   .block  1
  965.               buffer  .block  80
  966.       
  967.       TITLE. This directive allows the user to define a title string  that
  968.       appears  at the top of each page of the list file (assuming the PAGE
  969.       mode is on).  The format is:
  970.       
  971.                       .TITLE  "<string>"
  972.       
  973.       The string should not exceed 80 characters.  Here are some examples:
  974.       
  975.                       .TITLE  "Controller version 1.1"
  976.                       .title  "This is the title of the assembly"
  977.                       .title  ""
  978.       
  979.       
  980.       LIST/NOLIST.  These directives can be used to alternately turn the
  981.       output to the list file on (LIST) or off (NOLIST).  The format is:
  982.       
  983.               .LIST
  984.               .NOLIST
  985.       
  986.       
  987.       PAGE/NOPAGE. These directives can be used to  alternately  turn  the
  988.       paging mode on (PAGE) or off (NOPAGE).  If paging is in effect, then
  989.       every  sixty  lines  of  output  will  be  followed by a Top of Form
  990.       character and a two line header containing  page  number,  filename,
  991.       and the title.  The format is:
  992.       
  993.               .PAGE
  994.               .NOPAGE
  995.       
  996.       
  997.       
  998.       EJECT.  This  directive  can  be used to force a Top of Form and the
  999.       generation of a page header on the list file.  It has no  effect  if
  1000.       the paging mode is off (see PAGE/NOPAGE).  The format is:
  1001.       
  1002.               .EJECT
  1003.       
  1004.       ADDINSTR.  This  directive  can  be  used   to   define   additional
  1005.       instructions for TASM to use in this assembly.  The format is:
  1006.       
  1007.       [<label>]   .ADDINSTR   <inst> <args> <opcode> <nbytes> <modop> <class>
  1008.       
  1009.       The fields are separated by white space just as they would appear in an
  1010.       instruction definition file as described in TASM INSTRUCTION SET
  1011.       TABLE DEFINITION.
  1012.       
  1013.       END.   This   directive   should  follow  all  code/data  generating
  1014.       statements in the source file.  It forces  the  last  record  to  be
  1015.       written to the object file.  The format is:
  1016.       
  1017.               [<label>]       .END
  1018.       
  1019.       
  1020.       
  1021.  
  1022.       TASM - Table Driven Assembler                                Page 18  
  1023.       
  1024.       
  1025.       OBJECT FILE FORMATS
  1026.       
  1027.       TASM supports three object file formats:
  1028.       
  1029.               1.  Intel Hex (default).
  1030.               2.  MOS Technology Hex.
  1031.               3.  Binary
  1032.       
  1033.       Each are described below:
  1034.       
  1035.       
  1036.       
  1037.       Intel Hex Object Format. This is the default format.  This format is
  1038.       line  oriented  and  uses only printable ASCII characters except for
  1039.       the carriage return/line feed at the end of each line.  Each line in
  1040.       the file assumes the following format:
  1041.       
  1042.       :NNAAAARRHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCCTT
  1043.       
  1044.       Where:
  1045.       
  1046.       All fields marked 'hex' consist of two  or  four  ASCII  hexadecimal
  1047.       digits  (0-9,  A-F).  A maximum of 24 data bytes will be represented
  1048.       on each line.
  1049.       
  1050.       :       = Record Start Character
  1051.       NN      = Byte Count (hex)
  1052.       AAAA    = Address of first byte (hex)
  1053.       RR      = Record Type (hex, 00 except for last record which is 01)
  1054.       HH      = Data Bytes (hex)
  1055.       CC      = Check Sum (hex)
  1056.       TT      = Line Terminator (carriage return, line feed)
  1057.       
  1058.       The last line of the file will be a record conforming to  the  above
  1059.       format with a byte count of zero (':00000001FF').
  1060.       
  1061.       The checksum is defined as:
  1062.       
  1063.               sum      =  byte_count + address_hi + address_lo +
  1064.                               record_type + (sum of all data bytes)
  1065.               checksum =  ((-sum) & ffh)
  1066.       
  1067.       
  1068.       
  1069.       
  1070.       
  1071.       
  1072.       
  1073.       
  1074.       
  1075.       
  1076.       
  1077.       
  1078.       
  1079.       
  1080.       
  1081.  
  1082.       TASM - Table Driven Assembler                                Page 19  
  1083.       
  1084.       
  1085.       MOS  Technology  Hex Object Format. This format is line oriented and
  1086.       uses  only  printable  ASCII  characters  except  for  the  carriage
  1087.       return/line  feed  at  the  end of each line.  Each line in the file
  1088.       assumes the following format:
  1089.       
  1090.       ;NNAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCCCCTT
  1091.       
  1092.       Where:
  1093.       
  1094.       All fields marked 'hex' consist of two  or  four  ASCII  hexadecimal
  1095.       digits  (0-9,  A-F).  A maximum of 24 data bytes will be represented
  1096.       on each line.
  1097.       
  1098.       ;       = Record Start Character
  1099.       NN      = Byte Count (hex)
  1100.       AAAA    = Address of first byte (hex)
  1101.       HH      = Data Bytes (hex)
  1102.       CCCC    = Check Sum (hex)
  1103.       TT      = Line Terminator (carriage return, line feed)
  1104.       
  1105.       The last line of the file will be a record with a byte count of zero
  1106.       (';00').
  1107.       
  1108.       The checksum is defined as:
  1109.       
  1110.               sum      =  byte_count + address_hi + address_lo +
  1111.                               record_type + (sum of all data bytes)
  1112.               checksum =  (sum & ffffh)
  1113.       
  1114.       
  1115.       
  1116.       
  1117.       
  1118.       Binary   Object   Format.   This  file  format  has  only  a  binary
  1119.       representation of each data byte with no address, checksum or format
  1120.       description,  whatsoever.  It is often a convenient format to use to
  1121.       pass  the  data to other programs on your PC (like a PROM programmer
  1122.       package) but because of the  nonprintability  and  lack  of  address
  1123.       information,  it  is  not  often  used to transmit the code to other
  1124.       systems.
  1125.       
  1126.       Note that when this object format is selected (-b  option),  the  -c 
  1127.       option  is  forced.  This  is  done so that no ambiguity arises as a 
  1128.       result of the lack of address information in the file.  Without  the 
  1129.       -c  option,   discontinuous  blocks  of  object  code  would  appear 
  1130.       contiguous.  
  1131.       
  1132.       
  1133.       
  1134.       
  1135.       
  1136.       
  1137.       
  1138.       
  1139.       
  1140.       
  1141.  
  1142.       TASM - Table Driven Assembler                                Page 20  
  1143.       
  1144.       
  1145.       LISTING FILE FORMAT
  1146.       
  1147.       Each line of source code generates one (or more) lines of output  in
  1148.       the listing file.  The fields of the output line are as follows:
  1149.       
  1150.               1.  Current  source  file  line  number  (4 decimal digits).
  1151.       
  1152.               2.  An optional '+' appears if this is  an  'INCLUDE'  file.
  1153.                       (One '+' for each level of INCLUDE invoked).
  1154.       
  1155.               3.  Current Instruction Pointer (4 hex digits).  An optional
  1156.                       '~' follows the Instruction Pointer if the  line  of
  1157.                       source  code  is  not  being assembled because of an
  1158.                       IFDEF, IFNDEF, or IF directive.
  1159.       
  1160.               4.  Resulting code/data generated from this source line (two
  1161.                       hex digits per byte, each byte separated by a space,
  1162.                       up to four bytes per line).
  1163.       
  1164.               5.  The  source  line  exactly  as  it appears in the source
  1165.                       file.
  1166.       
  1167.       If  paging  is  enabled (by either the '-p' option flag or the .PAGE
  1168.       directive) some additional fields will be inserted into the  listing
  1169.       file every 60 lines.  These fields are:
  1170.       
  1171.               1.  Top of Form (form feed).
  1172.               2.  Assembler identifier (e.g. "TASM 6502 Assembler").
  1173.               3.  Initial source file name.
  1174.               4.  Page number.
  1175.               5.  Title.
  1176.       
  1177.       For an example of the listing file format, see appendix A.
  1178.       
  1179.       
  1180.       
  1181.       
  1182.       
  1183.       
  1184.       
  1185.       
  1186.       
  1187.       
  1188.       
  1189.       
  1190.       
  1191.       
  1192.       
  1193.       
  1194.       
  1195.       
  1196.       
  1197.       
  1198.       
  1199.       
  1200.       
  1201.  
  1202.       TASM - Table Driven Assembler                                Page 21  
  1203.       
  1204.       
  1205.       PROM PROGRAMMING
  1206.       
  1207.       A wide variety of PROM programming equipment is available  that  can
  1208.       use  object  code  in  one or more of the formats TASM supports.  We
  1209.       will not try to list all such  compatible  systems  here,  but  will
  1210.       mention one configuration that has worked well for us.
  1211.       
  1212.       We have used the Apparat "IBM PROM Blaster,  24 Pin" (available from
  1213.       Apparat Inc.,  4401 Tamarac Parkway,  Denver,  Colorado 80237, $129)
  1214.       for programming 24  pin  EPROMs  with  much  success.  The  software
  1215.       supplied  with  this  product  will accept a TASM object file in the
  1216.       binary  format  (-b  option  flag  on  TASM   command   line).   The
  1217.       combination   of  TASM  and  the  PROM  Blaster  make  for  a  truly
  1218.       inexpensive solution to the problem of generating  PROMed  code  for
  1219.       target microprocessor systems.  (STI is not affiliated or associated
  1220.       with Apparat in any way).
  1221.       
  1222.       
  1223.       
  1224.       Some additional notes about generating code to be put in PROMs:
  1225.       
  1226.               1.  It  is  often  desirable  to  have all bytes in the PROM
  1227.                       programmed even if not explicitly assigned  a  value
  1228.                       in the source code (e.g.  the bytes are skipped over
  1229.                       with a .ORG statement).  This can be accomplished by
  1230.                       using the -c (contiguous block) and  the  -f  (fill)
  1231.                       command  line option flags.  The -c will ensure that
  1232.                       every byte from the lowest byte assigned a value  to
  1233.                       the the highest byte assigned a value will be in the
  1234.                       object  file  with no gaps.  The -f flag will assign
  1235.                       the specified value to all bytes before the assembly
  1236.                       begins so that when the object file is written,  all
  1237.                       bytes  not  assigned a value in the source code will
  1238.                       have a known value.  As an  example,  the  following
  1239.                       command  line  will  generate  object  code  in  the
  1240.                       default Intel Hex format with all bytes not assigned
  1241.                       a value in the source set to EA (hex, 6502 NOP):
  1242.       
  1243.                       tasm -65 -c -fEA test.asm
  1244.       
  1245.               2.  To ensure that TASM generates object code to  cover  the
  1246.                       full  address  range of the target PROM,  put a .ORG
  1247.                       statement at the end of the source file set  to  the
  1248.                       last address desired.  For example, to generate code
  1249.                       to  be  put  in  a  2716  EPROM  (2 Kbytes) from hex
  1250.                       address $1000 to $17ff,  do something like  this  in
  1251.                       the source file:
  1252.       
  1253.                                ;start of the file
  1254.                                .ORG    $1000
  1255.                                ;rest of the source code follows
  1256.        
  1257.                                <source code>
  1258.        
  1259.                                ;end of the source code
  1260.                                .ORG    $17ff
  1261.  
  1262.       TASM - Table Driven Assembler                                Page 22  
  1263.       
  1264.                                .BYTE   0
  1265.                                .END
  1266.       
  1267.                       Now,  to  invoke  TASM  to  generate the code in the
  1268.                       binary format with all unassigned bytes  set  to  00
  1269.                       (6502 BRK), do the following:
  1270.       
  1271.                       tasm -65 -b -f00 test.asm
  1272.       
  1273.                       Note that -b forces the -c option.
  1274.       
  1275.       
  1276.       
  1277.       
  1278.       
  1279.       
  1280.       
  1281.       
  1282.       
  1283.       
  1284.       
  1285.       
  1286.       
  1287.       
  1288.       
  1289.       
  1290.       
  1291.       
  1292.       
  1293.       
  1294.       
  1295.       
  1296.       
  1297.       
  1298.       
  1299.       
  1300.       
  1301.       
  1302.       
  1303.       
  1304.       
  1305.       
  1306.       
  1307.       
  1308.       
  1309.       
  1310.       
  1311.       
  1312.       
  1313.       
  1314.       
  1315.       
  1316.       
  1317.       
  1318.       
  1319.       
  1320.       
  1321.  
  1322.       TASM - Table Driven Assembler                                Page 23  
  1323.       
  1324.       
  1325.       ERROR MESSAGES
  1326.       
  1327.       
  1328.       Error Message                           Description
  1329.       --------------------------------------------------------
  1330.       unrecognized directive..................A statement starting  with a
  1331.                                               '.'  or  '#'  has a mnemonic
  1332.                                               that is  not  defined  as  a
  1333.                                               directive.
  1334.       
  1335.       unrecognized  instruction...............A  statement  has  an opcode
  1336.                                               mnemonic   that    is    not
  1337.                                               defined.
  1338.       
  1339.       unrecognized argument...................A statement has  an  operand
  1340.                                               format that is not defined.
  1341.       
  1342.       label value misaligned..................The value of a label appears
  1343.                                               to have a different value on
  1344.                                               the  second pass then it was
  1345.                                               computed  to  have  on   the
  1346.                                               first    pass.    This    is
  1347.                                               generally due to  Zero  Page
  1348.                                               Addressing   mode   problems
  1349.                                               with  the  6502  version  of
  1350.                                               TASM.  Labels  that are used
  1351.                                               in operands  for  statements
  1352.                                               that   could  utilized  Zero
  1353.                                               Page addressing mode  should
  1354.                                               always   be  defined  before
  1355.                                               used as an operand.
  1356.       
  1357.       label table overflow....................To  many  labels  have  been
  1358.                                               encountered.
  1359.       
  1360.       No END directive before EOF.............The source file did not have
  1361.                                               an   END  directive  in  it.
  1362.                                               This is not fatal,  but  may
  1363.                                               cause  the  last object file
  1364.                                               record to be lost.
  1365.       
  1366.       No  files  specified....................TASM  was  invoked  with  no
  1367.                                               source file specified.
  1368.       
  1369.       Unknown  option  flag...................TASM  was  invoked  with  an
  1370.                                               undefined option flag on the
  1371.                                               command line.
  1372.       
  1373.       Source file open error..................TASM was not  able  to  open
  1374.                                               the specified source file.
  1375.       
  1376.       List file open error....................TASM was not  able  to  open
  1377.                                               the specified list file.
  1378.       
  1379.       Object file open error..................TASM was not  able  to  open
  1380.                                               the specified object file.
  1381.  
  1382.       TASM - Table Driven Assembler                                Page 24  
  1383.       
  1384.       
  1385.       Unknown token...........................Unexpected  characters  were
  1386.                                               encountered while parsing an
  1387.                                               expression.
  1388.       
  1389.       maximum number of macros exceeded.......To  many  macros   (DEFINEs)
  1390.                                               have been encountered.
  1391.       
  1392.       macro buffer overflow...................The buffer from which  space
  1393.                                               is   allocated   for   macro
  1394.                                               definitions is exhausted.
  1395.       
  1396.       range of relative branch exceeded.......A branch instruction exceeds
  1397.                                               the  maximum   range   (6502
  1398.                                               Version).
  1399.       
  1400.       
  1401.       
  1402.       
  1403.       
  1404.       
  1405.       
  1406.       
  1407.       
  1408.       
  1409.       
  1410.       
  1411.       
  1412.       
  1413.       
  1414.       
  1415.       
  1416.       
  1417.       
  1418.       
  1419.       
  1420.       
  1421.       
  1422.       
  1423.       
  1424.       
  1425.       
  1426.       
  1427.       
  1428.       
  1429.       
  1430.       
  1431.       
  1432.       
  1433.       
  1434.       
  1435.       
  1436.       
  1437.       
  1438.       
  1439.       
  1440.       
  1441.  
  1442.       TASM - Table Driven Assembler                                Page 25  
  1443.       
  1444.       
  1445.       BUGS AND LIMITATIONS
  1446.       
  1447.       Limitations and Specifications
  1448.       ----------------------------------------------------------------
  1449.       Maximum number of labels                2000
  1450.       Maximum length of labels                13 characters
  1451.       Maximum address space                   64 Kbytes (65536 bytes)
  1452.       Maximum number of nested INCLUDES       6
  1453.       Maximum length of TITLE string          79 characters
  1454.       Maximum Source line length              255 characters
  1455.       Maximum length of expressions           255 characters
  1456.       Maximum length of pathnames             79 characters
  1457.       Maximum length of command line          127 characters
  1458.       
  1459.       Maximum number of macros                1000
  1460.       Maximum number of macro arguments       10
  1461.       Maximum length of macro argument        16 characters
  1462.       Heap size (for labels and macros)       20000 bytes
  1463.       
  1464.       Memory requirements                     160K (32K for code, 64K for
  1465.                                               data and stack, 64K for
  1466.                                               opcode memory image*).
  1467.       
  1468.       
  1469.       *Note that TASM uses the 64 Kbyte segment immediately following  the
  1470.       data/stack  segment to store assembled opcodes and data before being
  1471.       written to the object file.
  1472.       
  1473.       
  1474.       Bugs
  1475.       
  1476.       1.  The 8048 version of TASM does not check for use of memory beyond
  1477.               any  reasonable  bounds (e.g.  an 8048 has a maximum address
  1478.               space of 4 Kbytes but TASM will let  you  pretend  that  you
  1479.               have 64 Kbytes).
  1480.       
  1481.       2.  Expression evaluation has no operator precedence in effect which
  1482.               can  make  for  unexpected results if not explicitly grouped
  1483.               with parenthesis.
  1484.       
  1485.       3.  First  page  of  listing file will not show a user defined title
  1486.               (defined via TITLE directive).
  1487.       
  1488.       4.  TASM sometimes does not generate error messages  for  improperly
  1489.               formed expressions.
  1490.       
  1491.       5.  TASM expands macros in comments at the end of a line (but not in
  1492.               lines that are all comment).
  1493.       
  1494.       6.  TASM does not generate an error message when a EQU directive has
  1495.               an undefined label on the right hand side.
  1496.       
  1497.       
  1498.       
  1499.       
  1500.       
  1501.  
  1502.       TASM - Table Driven Assembler                                Page 26  
  1503.       
  1504.       
  1505.       6502 INSTRUCTIONS AND ADDRESSING MODES
  1506.       
  1507.       The acceptable 6502 opcode mnemonics for TASM are as follows:
  1508.       
  1509.                ADC  AND  ASL  BCC  BCS  BEQ  BNE  BMI  BPL  BVC  BVS  BIT
  1510.                BRK  CLC  CLD  CLI  CLV  CMP  CPX  CPY  DEC  DEX  DEY  EOR
  1511.                INC  INX  INY  JMP  JSR  LDA  LDX  LDY  LSR  NOP  ORA  PHA
  1512.                PHP  PLA  PLP  ROL  ROR  RTI  RTS  SBC  SEC  SED  SEI  STA
  1513.                STX  STY  TAX  TAY  TSX  TXA  TXS  TYA
  1514.       
  1515.       TASM  also  supports the following instructions that are part of the
  1516.       Rockwell  R65C02  and  R65C00/21  microprocessor  instruction  sets.
  1517.       Those  that  are  marked  as  set A are applicable to the R65C02 and
  1518.       those marked as set B are  applicable  to  the  R65C00/21  (A+B  for
  1519.       both):
  1520.       
  1521.               Mnemonic        Description                Address Mode  Set
  1522.               ---------------------------------------------------------------
  1523.               ADC             Add with carry             (IND)         A
  1524.               AND             And memory with A          (IND)         A
  1525.               BIT             Test memory bits with A    ABS,X         A
  1526.               BIT             Test memory bits with A    ZP,X          A
  1527.               BIT             Test memory bits with A    IMM           A
  1528.               CMP             Compare memory with A      (IND)         A
  1529.               DEC             Decrement A                A             A
  1530.               EOR             Exclusive OR memory with A (IND)         A
  1531.               INC             Increment A                A             A
  1532.               JMP             Jump                       (ABS,X)       A
  1533.               LDA             Load A with memory         (IND)         A
  1534.               ORA             OR A with memory           (IND)         A
  1535.               SBC             Subtract memory form A     (IND)         A
  1536.               STA             Store A in memory          (IND)         A
  1537.               STZ             Store zero                 ABS           A
  1538.               STZ             Store zero                 ABS,X         A
  1539.               STZ             Store zero                 ZP            A
  1540.               STZ             Store zero                 ZP,X          A
  1541.               TRB             Test and reset memory bit  ABS           A
  1542.               TRB             Test and reset memory bit  ZP            A
  1543.               TSB             Test and set memory bit    ABS           A
  1544.               TSB             Test and set memory bit    ZP            A
  1545.       
  1546.               BRA             Branch Always              REL           A+B
  1547.       
  1548.               BBR0            Branch on Bit 0 Reset      ZP,REL        A+B
  1549.               BBR1            Branch on Bit 1 Reset      ZP,REL        A+B
  1550.               BBR2            Branch on Bit 2 Reset      ZP,REL        A+B
  1551.               BBR3            Branch on Bit 3 Reset      ZP,REL        A+B
  1552.               BBR4            Branch on Bit 4 Reset      ZP,REL        A+B
  1553.               BBR5            Branch on Bit 5 Reset      ZP,REL        A+B
  1554.               BBR6            Branch on Bit 6 Reset      ZP,REL        A+B
  1555.               BBR7            Branch on Bit 7 Reset      ZP,REL        A+B
  1556.       
  1557.               BBS0            Branch on Bit 0 Set        ZP,REL        A+B
  1558.               BBS1            Branch on Bit 1 Set        ZP,REL        A+B
  1559.               BBS2            Branch on Bit 2 Set        ZP,REL        A+B
  1560.               BBS3            Branch on Bit 3 Set        ZP,REL        A+B
  1561.  
  1562.       TASM - Table Driven Assembler                                Page 27  
  1563.       
  1564.               BBS4            Branch on Bit 4 Set        ZP,REL        A+B
  1565.               BBS5            Branch on Bit 5 Set        ZP,REL        A+B
  1566.               BBS6            Branch on Bit 6 Set        ZP,REL        A+B
  1567.               BBS7            Branch on Bit 7 Set        ZP,REL        A+B
  1568.       
  1569.               MUL             Multiply                   Implied       B
  1570.       
  1571.               PHX             Push Index X               Implied       A+B
  1572.               PHY             Push Index Y               Implied       A+B
  1573.               PLX             Pull Index X               Implied       A+B
  1574.               PLY             Pull Index Y               Implied       A+B
  1575.       
  1576.               RMB0            Reset Memory Bit 0         ZP            A+B
  1577.               RMB1            Reset Memory Bit 1         ZP            A+B
  1578.               RMB2            Reset Memory Bit 2         ZP            A+B
  1579.               RMB3            Reset Memory Bit 3         ZP            A+B
  1580.               RMB4            Reset Memory Bit 4         ZP            A+B
  1581.               RMB5            Reset Memory Bit 5         ZP            A+B
  1582.               RMB6            Reset Memory Bit 6         ZP            A+B
  1583.               RMB7            Reset Memory Bit 7         ZP            A+B
  1584.       
  1585.               SMB0            Set   Memory Bit 0         ZP            A+B
  1586.               SMB1            Set   Memory Bit 1         ZP            A+B
  1587.               SMB2            Set   Memory Bit 2         ZP            A+B
  1588.               SMB3            Set   Memory Bit 3         ZP            A+B
  1589.               SMB4            Set   Memory Bit 4         ZP            A+B
  1590.               SMB5            Set   Memory Bit 5         ZP            A+B
  1591.               SMB6            Set   Memory Bit 6         ZP            A+B
  1592.               SMB7            Set   Memory Bit 7         ZP            A+B
  1593.       
  1594.       Note that correct assembly of these extended  instructions  has  not
  1595.       been tested on a target system.
  1596.       
  1597.       Addressing  modes  are denoted as follows:
  1598.       
  1599.               ABS               Absolute
  1600.               ZP                Zero Page
  1601.               ABS,X             Absolute X
  1602.               ZP,X              Zero Page X
  1603.               ABS,Y             Absolute Y
  1604.               ZP,Y              Zero Page Y
  1605.               A                 Accumulator
  1606.               (IND,X)           Indirect X
  1607.               (IND),Y           Indirect Y
  1608.               (IND)             Indirect
  1609.               #IMM              Immediate
  1610.               REL               Relative (Branch instructions only)
  1611.               ZP,REL            Zero Page, Relative
  1612.               Implied           Implied
  1613.       
  1614.       Note  that Zero Page addressing can not be explicitly requested.  It
  1615.       is used if the value of the operand is  representable  in  a  single
  1616.       byte for the applicable statements.
  1617.       
  1618.       The '-x' command line option can be  used  to  enable  the  extended
  1619.       instructions.  A  '-x'  with  no  digit  following  will  enable the
  1620.       standard set plus both extended sets.  The 6502 version of TASM uses
  1621.  
  1622.       TASM - Table Driven Assembler                                Page 28  
  1623.       
  1624.       three bits in the instruction class  mask  to  determine  whether  a
  1625.       given  instruction  is enabled or not.  Bit 0 enables the basic set,
  1626.       bit 1 enables set A (R65C02) and bit 2 enables  set  B  (R65C00/21).
  1627.       The following table shows various options:
  1628.       
  1629.               Class Mask        Enabled Instructions
  1630.                               BASIC   R65C02  R65C00/21
  1631.               --------------------------------------------
  1632.               1               yes     no      no
  1633.               2               no      yes     no
  1634.               3               yes     yes     no
  1635.               4               no      no      yes
  1636.               5               yes     no      yes
  1637.               6               no      yes     yes
  1638.               7               yes     yes     yes
  1639.       
  1640.       Thus,  to enable the basic set plus the R65C02 instructions,  invoke
  1641.       the '-x3' command line option.
  1642.       
  1643.       See manufacturer's data for  a  more  complete  description  of  the
  1644.       meaning of the mnemonics and addressing modes.
  1645.       
  1646.       
  1647.       
  1648.       
  1649.       
  1650.       
  1651.       
  1652.       
  1653.       
  1654.       
  1655.       
  1656.       
  1657.       
  1658.       
  1659.       
  1660.       
  1661.       
  1662.       
  1663.       
  1664.       
  1665.       
  1666.       
  1667.       
  1668.       
  1669.       
  1670.       
  1671.       
  1672.       
  1673.       
  1674.       
  1675.       
  1676.       
  1677.       
  1678.       
  1679.       
  1680.       
  1681.  
  1682.       TASM - Table Driven Assembler                                Page 29  
  1683.       
  1684.       
  1685.       8048 INSTRUCTIONS AND ADDRESSING MODES
  1686.       
  1687.       The following list shows the acceptable opcode mnemonics  and  their
  1688.       corresponding  operand  formats for the 8048 version of TASM.  Where
  1689.       'Rn' is seen,  R0 through R7  may  be  substituted.  Other  symbolic
  1690.       fields are as follows:
  1691.       
  1692.               SYMBOLIC            DESCRIPTION
  1693.               -----------------------------------------------
  1694.               <addr8>             Absolute address (8 bits)
  1695.               <addr11>            Absolute address (11 bits)
  1696.               <immed>             Immediate data
  1697.       
  1698.       Any valid TASM expression can appear in the  place  of  any  of  the
  1699.       above symbolics.
  1700.       
  1701.       The lines that are marked with an (8041),  (8022),  or (8021) on the
  1702.       far  right are extended instructions that are available only if a -x
  1703.       option has  been  invoked  on  the  command  line.  The  classes  of
  1704.       instructions  (and their bit assignment in the class mask) are shown
  1705.       below:
  1706.       
  1707.               BIT     PROCESSOR
  1708.               -------------------------------
  1709.               0       8X48, 8035, 8039, 8049
  1710.               1       8X41A
  1711.               2       8022
  1712.               3       8021
  1713.       
  1714.       Thus, to enable the basic 8048 set plus the 8022 set, a -x5 could be
  1715.       used on the command line.
  1716.       
  1717.       Note that some of the base instructions should be disabled  for  the
  1718.       8041, 8022, and 8021, but are not.
  1719.       
  1720.       OPCODE  OPERANDS        DESCRIPTION
  1721.       -------------------------------------------------------------------
  1722.       ADD     A,Rn            Add Register to Acc
  1723.       ADD     A,@R0           Add Indirect RAM to Acc
  1724.       ADD     A,@R1           Add Indirect RAM to Acc
  1725.       ADD     A,#<immed>      Add Immediate data to Acc
  1726.       
  1727.       ADDC    A,Rn            Add Register to Acc with carry
  1728.       ADDC    A,@R0           Add Indirect RAM to Acc with carry
  1729.       ADDC    A,@R1           Add Indirect RAM to Acc with carry
  1730.       ADDC    A,#<immed>      Add Immediate data to Acc with carry
  1731.       
  1732.       ANL     A,Rn            AND Register to Acc
  1733.       ANL     A,@R0           AND Indirect RAM to Acc
  1734.       ANL     A,@R1           AND Indirect RAM to Acc
  1735.       ANL     A,#<immed>      AND Immediate data to Acc
  1736.       ANL     BUS,#<immed>    AND Immediate data to BUS
  1737.       ANL     P1,#<immed>     AND Immediate data to port P1
  1738.       ANL     P2,#<immed>     AND Immediate data to port P2
  1739.       
  1740.       ANLD    P4,A            AND Acc to Expander port P4
  1741.  
  1742.       TASM - Table Driven Assembler                                Page 30  
  1743.       
  1744.       ANLD    P5,A            AND Acc to Expander port P5
  1745.       ANLD    P6,A            AND Acc to Expander port P6
  1746.       ANLD    P7,A            AND Acc to Expander port P7
  1747.       
  1748.       CALL    <addr11>        Call subroutine
  1749.       
  1750.       CLR     A               Clear Acc
  1751.       CLR     C               Clear Carry
  1752.       CLR     F0              Clear Flag 0
  1753.       CLR     F1              Clear Flag 1
  1754.       
  1755.       CPL     A               Complement Acc
  1756.       CPL     C               Complement Carry
  1757.       CPL     F0              Complement Flag F0
  1758.       CPL     F1              Complement Flag F1
  1759.       
  1760.       DA      A               Decimal adjust Acc
  1761.       
  1762.       DEC     A               Decrement Acc
  1763.       DEC     Rn              Decrement Register
  1764.       
  1765.       DIS     I               Disable Interrupts
  1766.       DIS     TCNTI           Disable Timer/Counter Interrupt
  1767.       
  1768.       DJNZ    Rn,<addr8>      Decrement Register and Jump if nonzero
  1769.       
  1770.       EN      DMA             Enable DMA                           (8041)
  1771.       EN      FLAGS           Enable Flags                         (8041)
  1772.       EN      I               Enable External Interrupt
  1773.       EN      TCNTI           Enable Timer/Counter Interrupt
  1774.       ENT0    CLK             Enable Clock Output
  1775.       
  1776.       IN      A,DBB           Input Data Bus to Acc                (8041)
  1777.       IN      A,P0            Input Port 0 to Acc                  (8021)
  1778.       IN      A,P1            Input Port 1 to Acc
  1779.       IN      A,P2            Input Port 2 to Acc
  1780.       
  1781.       INC     A               Increment Acc
  1782.       INC     Rn              Increment Register
  1783.       INC     @R0             Increment Indirect RAM
  1784.       INC     @R1             Increment Indirect RAM
  1785.       
  1786.       INS     A,BUS           Strobed Input of Bus to Acc
  1787.       
  1788.       JB0     <addr8>         Jump if Acc bit 0 is set
  1789.       JB1     <addr8>         Jump if Acc bit 1 is set
  1790.       JB2     <addr8>         Jump if Acc bit 2 is set
  1791.       JB3     <addr8>         Jump if Acc bit 3 is set
  1792.       JB4     <addr8>         Jump if Acc bit 4 is set
  1793.       JB5     <addr8>         Jump if Acc bit 5 is set
  1794.       JB6     <addr8>         Jump if Acc bit 6 is set
  1795.       JB7     <addr8>         Jump if Acc bit 7 is set
  1796.       JMP     <addr11>        Jump
  1797.       JC      <addr8>         Jump if Carry is set
  1798.       JF0     <addr8>         Jump if Flag F0 is set
  1799.       JF1     <addr8>         Jump if Flag F1 is set
  1800.       JNC     <addr8>         Jump if Carry is clear
  1801.  
  1802.       TASM - Table Driven Assembler                                Page 31  
  1803.       
  1804.       JNI     <addr8>         Jump if Interrupt input is clear
  1805.       JNIBF   <addr8>         Jump if IBF is clear                 (8041)
  1806.       JNT0    <addr8>         Jump if T0 is clear
  1807.       JNT1    <addr8>         Jump if T1 is clear
  1808.       JNZ     <addr8>         Jump if Acc is not zero
  1809.       JOBF    <addr8>         Jump if OBF is set                   (8041)
  1810.       JTF     <addr8>         Jump if Timer Flag is set
  1811.       JT0     <addr8>         Jump if T0 pin is high
  1812.       JT1     <addr8>         Jump if T1 pin is high
  1813.       JZ      <addr8>         Jump if Acc is zero
  1814.       JMPP    @A              Jump Indirect (current page)
  1815.       
  1816.       MOV     A,PSW           Move PSW to Acc
  1817.       MOV     A,Rn            Move Register to Acc
  1818.       MOV     A,T             Move Timer/Counter to Acc
  1819.       MOV     A,@R0           Move Indirect RAM to Acc
  1820.       MOV     A,@R1           Move Indirect RAM to Acc
  1821.       MOV     A,#<immed>      Move Immediate data to Acc
  1822.       MOV     PSW,A           Move Acc to PSW
  1823.       MOV     Rn,A            Move Acc to Register
  1824.       MOV     Rn,#<immed>     Move Immediate data to Register
  1825.       MOV     STS,A           Move Acc to STS                      (8041)
  1826.       MOV     T,A             Move Acc to Timer/Counter
  1827.       MOV     @R0,A           Move Acc to Indirect RAM
  1828.       MOV     @R1,A           Move Acc to Indirect RAM
  1829.       MOV     @R0,#<immed>    Move Immediate data to Indirect RAM
  1830.       MOV     @R1,#<immed>    Move Immediate data to Indirect RAM
  1831.       
  1832.       MOVD    A,P4            Move half-byte Port 4 to Acc (lower nibble)
  1833.       MOVD    A,P5            Move half-byte Port 5 to Acc (lower nibble)
  1834.       MOVD    A,P6            Move half-byte Port 6 to Acc (lower nibble)
  1835.       MOVD    A,P7            Move half-byte Port 7 to Acc (lower nibble)
  1836.       MOVD    P4,A            Move lower nibble of Acc to Port 4
  1837.       MOVD    P5,A            Move lower nibble of Acc to Port 5
  1838.       MOVD    P6,A            Move lower nibble of Acc to Port 6
  1839.       MOVD    P7,A            Move lower nibble of Acc to Port 7
  1840.       
  1841.       MOVP    A,@A            Move Indirect Program data to Acc
  1842.       MOVP3   A,@A            Move Indirect Program data to Acc (page 3)
  1843.       
  1844.       MOVX    A,@R0           Move Indirect External RAM to Acc
  1845.       MOVX    A,@R1           Move Indirect External RAM to Acc
  1846.       MOVX    @R0,A           Move Acc to Indirect External RAM
  1847.       MOVX    @R1,A           Move Acc to Indirect External RAM
  1848.       
  1849.       NOP                     No operation
  1850.       
  1851.       ORL     A,Rn            OR Register to Acc
  1852.       ORL     A,@R0           OR Indirect RAM to Acc
  1853.       ORL     A,@R1           OR Indirect RAM to Acc
  1854.       ORL     A,#<immed>      OR Immediate data to Acc
  1855.       ORL     BUS,#<immed>    OR Immediate data to BUS
  1856.       ORL     P1,#<immed>     OR Immediate data to port P1
  1857.       ORL     P2,#<immed>     OR Immediate data to port P2
  1858.       
  1859.       ORLD    P4,A            OR lower nibble of Acc with P4
  1860.       ORLD    P5,A            OR lower nibble of Acc with P5
  1861.  
  1862.       TASM - Table Driven Assembler                                Page 32  
  1863.       
  1864.       ORLD    P6,A            OR lower nibble of Acc with P6
  1865.       ORLD    P7,A            OR lower nibble of Acc with P7
  1866.       
  1867.       OUTL    BUS,A           Output Acc to Bus
  1868.       OUT     DBB,A           Output Acc to DBB                    (8041)
  1869.       OUTL    P0,A            Output Acc to Port P0                (8021)
  1870.       OUTL    P1,A            Output Acc to Port P1
  1871.       OUTL    P2,A            Output Acc to Port P2
  1872.       
  1873.       RAD                     Move A/D Converter to Acc            (8022)
  1874.       
  1875.       RET                     Return from subroutine
  1876.       RETI                    Return from Interrupt w/o PSW restore(8022)
  1877.       RETR                    Return from Interrupt w/  PSW restore
  1878.       
  1879.       RL      A               Rotate Acc Left
  1880.       RLC     A               Rotate Acc Left through Carry
  1881.       RR      A               Rotate Acc Right
  1882.       RRC     A               Rotate Acc Right through Carry
  1883.       
  1884.       SEL     AN0             Select Analog Input 0                (8022)
  1885.       SEL     AN1             Select Analog Input 1                (8022)
  1886.       SEL     MB0             Select Memory Bank 0
  1887.       SEL     MB1             Select Memory Bank 1
  1888.       SEL     RB0             Select Register Bank 0
  1889.       SEL     RB1             Select Register Bank 1
  1890.       
  1891.       STOP    TCNT            Stop Timer/Counter
  1892.       STRT    CNT             Start Counter
  1893.       STRT    T               Start Timer
  1894.       
  1895.       SWAP    A               Swap nibbles of Acc
  1896.       
  1897.       XCH     A,Rn            Exchange Register with Acc
  1898.       XCH     A,@R0           Exchange Indirect RAM with Acc
  1899.       XCH     A,@R1           Exchange Indirect RAM with Acc
  1900.       
  1901.       XCHD    A,@R0           Exchange lower nibble of Indirect RAM w/ Acc
  1902.       XCHD    A,@R1           Exchange lower nibble of Indirect RAM w/ Acc
  1903.       
  1904.       XRL     A,Rn            Exclusive OR Register to Acc
  1905.       XRL     A,@R0           Exclusive OR Indirect RAM to Acc
  1906.       XRL     A,@R1           Exclusive OR Indirect RAM to Acc
  1907.       XRL     A,#<immed>      Exclusive OR Immediate data to Acc
  1908.       
  1909.       
  1910.       See manufacturer's data for  a  more  complete  description  of  the
  1911.       meaning of the mnemonics and addressing modes.
  1912.       
  1913.       
  1914.       
  1915.       
  1916.       
  1917.       
  1918.       
  1919.       
  1920.       
  1921.  
  1922.       TASM - Table Driven Assembler                                Page 33  
  1923.       
  1924.       
  1925.       8051 INSTRUCTIONS AND ADDRESSING MODES
  1926.       
  1927.       The following list shows the acceptable opcode mnemonics  and  their
  1928.       corresponding  operand  formats for the 8051 version of TASM.  Where
  1929.       'Rn' is seen,  R0 through R7  may  be  substituted.  Other  symbolic
  1930.       fields are as follows:
  1931.       
  1932.               SYMBOLIC            DESCRIPTION
  1933.               -----------------------------------------------
  1934.               <addr11>            Absolute address (11 bits)
  1935.               <addr16>            Absolute address (16 bits)
  1936.               <bit>               Bit address
  1937.               <immed>             Immediate data
  1938.               <direct>            Direct RAM address
  1939.               <rel>               Relative address
  1940.       
  1941.       Any valid TASM expression can appear in the  place  of  any  of  the
  1942.       above symbolics.
  1943.       
  1944.       OPCODE  OPERAND             DESCRIPTION
  1945.       --------------------------------------------------------------------
  1946.       ACALL   <addr11>            Absolute Call
  1947.       
  1948.       ADD     A,Rn                Add Register to Acc
  1949.       ADD     A,@R0               Add Indirect RAM to Acc
  1950.       ADD     A,@R1               Add Indirect RAM to Acc
  1951.       ADD     A,#<immed>          Add Immediate data to Acc
  1952.       ADD     A,<direct>          Add Direct RAM to Acc
  1953.       
  1954.       ADDC    A,Rn                Add Register to Acc with carry
  1955.       ADDC    A,@R0               Add Indirect RAM to Acc with carry
  1956.       ADDC    A,@R1               Add Indirect RAM to Acc with carry
  1957.       ADDC    A,#<immed>          Add Immediate data to Acc with carry
  1958.       ADDC    A,<direct>          Add Direct RAM to Acc with carry
  1959.       
  1960.       AJMP    <addr11>            Absolute Jump
  1961.       
  1962.       ANL     A,Rn                AND Register and Acc
  1963.       ANL     A,@R0               AND Indirect RAM and Acc
  1964.       ANL     A,@R1               AND Indirect RAM and Acc
  1965.       ANL     A,#<immed>          AND Immediate data and Acc
  1966.       ANL     A,<direct>          AND Direct RAM and Acc
  1967.       ANL     C,/<direct>         AND Complement of direct bit to Carry
  1968.       ANL     C,<direct>          AND direct bit to Carry
  1969.       ANL     <direct>,A          AND Acc to direct RAM
  1970.       ANL     <direct>,#<immed>   AND Immediate data and direct RAM
  1971.       
  1972.       CJNE    A,#<immed>,<rel>    Compare Immediate to Acc   and JNE
  1973.       CJNE    A,<direct>,<rel>    Compare direct RAM to Acc and JNE
  1974.       CJNE    Rn,#<immed>,<rel>   Compare Immediate to Register and JNE
  1975.       CJNE    @R0,#<immed>,<rel>  Compare Immediate to Indirect RAM and JNE
  1976.       CJNE    @R1,#<immed>,<rel>  Compare Immediate to Indirect RAM and JNE
  1977.       
  1978.       CLR     A                   Clear Accumulator
  1979.       CLR     C                   Clear Carry
  1980.       CLR     <direct>            Clear Direct RAM
  1981.  
  1982.       TASM - Table Driven Assembler                                Page 34  
  1983.       
  1984.       
  1985.       CPL     A                   Complement Accumulator
  1986.       CPL     C                   Complement Carry
  1987.       CPL     <direct>            Complement Direct RAM
  1988.       
  1989.       DA      A                   Decimal Adjust Accumulator
  1990.       
  1991.       DEC     A                   Decrement Acc
  1992.       DEC     Rn                  Decrement Register
  1993.       DEC     @R0                 Decrement Indirect RAM
  1994.       DEC     @R1                 Decrement Indirect RAM
  1995.       DEC     <direct>            Decrement Direct RAM
  1996.       
  1997.       DIV     AB                  Divide Acc by B
  1998.       
  1999.       DJNZ    Rn,<rel>            Decrement Register and JNZ
  2000.       DJNZ    <direct>,<rel>      Decrement Direct RAM and JNZ
  2001.       
  2002.       INC     A                   Increment Acc
  2003.       INC     Rn                  Increment Register
  2004.       INC     @R0                 Increment Indirect RAM
  2005.       INC     @R1                 Increment Indirect RAM
  2006.       INC     DPTR                Increment Data Pointer
  2007.       INC     <direct>            Increment Direct RAM
  2008.       
  2009.       JB      <bit>,<rel>         Jump if Bit is set
  2010.       JBC     <bit>,<rel>         Jump if Bit is set & clear Bit
  2011.       JC      <rel>               Jump if Carry is set
  2012.       JMP     @A+DPTR             Jump indirect relative to Data Pointer
  2013.       JNB     <bit>,<rel>         Jump if Bit is clear
  2014.       JNC     <rel>               Jump if Carry is clear
  2015.       JNZ     <rel>               Jump if Acc is not zero
  2016.       JZ      <rel>               Jump if Acc is zero
  2017.       
  2018.       LCALL   <addr16>            Long Subroutine Call
  2019.       LJMP    <addr16>            Long Jump
  2020.       
  2021.       MOV     A,Rn                Move Register to Acc
  2022.       MOV     A,@R0               Move Indirect RAM to Acc
  2023.       MOV     A,@R1               Move Indirect RAM to Acc
  2024.       MOV     A,#<immed>          Move Immediate data to Acc
  2025.       MOV     A,<direct>          Move direct RAM to Acc
  2026.       MOV     C,<bit>             Move bit to Acc
  2027.       MOV     DPTR,#<immed>       Move immediate data to Data Pointer
  2028.       MOV     Rn,A                Move Acc to Register
  2029.       MOV     Rn,#<immed>         Move Immediate data to Register
  2030.       MOV     Rn,<direct>         Move Direct RAM to Register
  2031.       MOV     @R0,A               Move Acc to Indirect RAM
  2032.       MOV     @R1,A               Move Acc to Indirect RAM
  2033.       MOV     @R0,#<immed>        Move Immediate data to Indirect RAM
  2034.       MOV     @R1,#<immed>        Move Immediate data to Indirect RAM
  2035.       MOV     @R0,<direct>        Move Direct RAM to Indirect RAM
  2036.       MOV     @R1,<direct>        Move Direct RAM to Indirect RAM
  2037.       MOV     <direct>,A          Move Acc to Direct RAM
  2038.       MOV     <bit>,C             Move Carry to Bit
  2039.       MOV     <direct>,Rn         Move Register to Direct RAM
  2040.       MOV     <direct>,@R0        Move Indirect RAM to Direct RAM
  2041.  
  2042.       TASM - Table Driven Assembler                                Page 35  
  2043.       
  2044.       MOV     <direct>,@R1        Move Indirect RAM to Direct RAM
  2045.       MOV     <direct>,#<immed>   Move Immediate data to Direct RAM
  2046.       MOV     <direct>,<direct>   Move Direct RAM to Direct RAM
  2047.       MOVC    A,@A+DPTR           Move code byte relative to DPTR to Acc
  2048.       MOVC    A,@A+PC             Move code byte relative to PC to Acc
  2049.       
  2050.       MOVX    A,@R0               Move external RAM to Acc
  2051.       MOVX    A,@R1               Move external RAM to Acc
  2052.       MOVX    A,@DPTR             Move external RAM to Acc (16 bit addr)
  2053.       MOVX    @R0,A               Move Acc to external RAM
  2054.       MOVX    @R1,A               Move Acc to external RAM
  2055.       MOVX    @DPTR,A             Move Acc to external RAM (16 bit addr)
  2056.       
  2057.       MUL     AB                  Multiply Acc by B
  2058.       
  2059.       NOP                         No operation
  2060.       
  2061.       ORL     A,Rn                OR Register and Acc
  2062.       ORL     A,@R0               OR Indirect RAM and Acc
  2063.       ORL     A,@R1               OR Indirect RAM and Acc
  2064.       ORL     A,#<immed>          OR Immediate data and Acc
  2065.       ORL     A,<direct>          OR Direct RAM and Acc
  2066.       ORL     C,/<direct>         OR Complement of direct bit to Carry
  2067.       ORL     C,<direct>          OR direct bit to Carry
  2068.       ORL     <direct>,A          OR Acc to direct RAM
  2069.       ORL     <direct>,#<immed>   OR Immediate data and direct RAM
  2070.       
  2071.       POP     <direct>            Pop  from Stack and put in Direct RAM
  2072.       PUSH    <direct>            Push from Direct RAM to Stack
  2073.       
  2074.       RET                         Return from subroutine
  2075.       RETI                        Return from Interrupt
  2076.       
  2077.       RL      A                   Rotate Acc left
  2078.       RLC     A                   Rotate Acc left through Carry
  2079.       RR      A                   Rotate Acc right
  2080.       RRC     A                   Rotate Acc right through Carry
  2081.       
  2082.       SETB    C                   Set the Carry Bit
  2083.       SETB    <bit>               Set Direct Bit
  2084.       
  2085.       SJMP    <rel>               Short jump
  2086.       
  2087.       SUBB    A,Rn                Subtract Register from Acc with Borrow
  2088.       SUBB    A,@R0               Subtract Indirect RAM from Acc w/ Borrow
  2089.       SUBB    A,@R1               Subtract Indirect RAM from Acc w/ Borrow
  2090.       SUBB    A,#<immed>          Subtract Immediate data from Acc w/ Borrow
  2091.       SUBB    A,<direct>          Subtract Direct RAM from Acc w/ Borrow
  2092.       
  2093.       SWAP    A                   Swap nibbles of Acc
  2094.       
  2095.       XCH     A,Rn                Exchange Acc with Register
  2096.       XCH     A,@R0               Exchange Acc with Indirect RAM
  2097.       XCH     A,@R1               Exchange Acc with Indirect RAM
  2098.       XCH     A,<direct>          Exchange Acc with Direct RAM
  2099.       
  2100.       XCHD    A,@R0               Exchange Digit in Acc with Indirect RAM
  2101.  
  2102.       TASM - Table Driven Assembler                                Page 36  
  2103.       
  2104.       XCHD    A,@R1               Exchange Digit in Acc with Indirect RAM
  2105.       
  2106.       XRL     A,Rn                Exclusive OR Register and Acc
  2107.       XRL     A,@R0               Exclusive OR Indirect RAM and Acc
  2108.       XRL     A,@R1               Exclusive OR Indirect RAM and Acc
  2109.       XRL     A,#<immed>          Exclusive OR Immediate data and Acc
  2110.       XRL     A,<direct>          Exclusive OR Direct RAM and Acc
  2111.       XRL     <direct>,A          Exclusive OR Acc to direct RAM
  2112.       XRL     <direct>,#<immed>   Exclusive OR Immediate data and direct RAM
  2113.       
  2114.       Note  that  the above tables do not automatically define the various
  2115.       mnemonics that may be  used  for  addressing  the  special  function
  2116.       registers  of  the  8051.  The  user  may  wish  to set up a file of
  2117.       equates (EQU's) that can be included in the  source  file  for  this
  2118.       purpose.  The following illustrates some of the appropriate equates:
  2119.       
  2120.       P0      .equ    080H    ;Port 0
  2121.       SP      .equ    081H    ;Stack pointer
  2122.       DPL     .equ    082H
  2123.       DPH     .equ    083H
  2124.       PCON    .equ    087H
  2125.       TCON    .equ    088H
  2126.       TMOD    .equ    089H
  2127.       TL0     .equ    08AH
  2128.       TL1     .equ    08BH
  2129.       TH0     .equ    08CH
  2130.       TH1     .equ    08DH
  2131.       P1      .equ    090H    ;Port 1
  2132.       SCON    .equ    098H
  2133.       SBUF    .equ    099H
  2134.       P2      .equ    0A0H    ;Port 2
  2135.       IEC     .equ    0A8H
  2136.       P3      .equ    0B0H    ;Port 3
  2137.       IPC     .equ    0B8H
  2138.       PSW     .equ    0D0H
  2139.       ACC     .equ    0E0H    ;Accumulator
  2140.       B       .equ    0F0H    ;Secondary Accumulator
  2141.       ;Now some bit addresses
  2142.       P0.0    .equ    080H    ;Port 0 bit 0
  2143.       P0.1    .equ    081H    ;Port 0 bit 1
  2144.       P0.2    .equ    082H    ;Port 0 bit 2
  2145.       P0.3    .equ    083H    ;Port 0 bit 3
  2146.       P0.4    .equ    080H    ;Port 0 bit 4
  2147.       P0.5    .equ    081H    ;Port 0 bit 5
  2148.       P0.6    .equ    082H    ;Port 0 bit 6
  2149.       P0.7    .equ    083H    ;Port 0 bit 7
  2150.       ACC.0   .equ    0E0H    ;Acc bit 0
  2151.       ACC.1   .equ    0E1H    ;Acc bit 1
  2152.       ACC.2   .equ    0E2H    ;Acc bit 2
  2153.       ACC.3   .equ    0E3H    ;Acc bit 3
  2154.       ACC.4   .equ    0E4H    ;Acc bit 4
  2155.       ACC.5   .equ    0E5H    ;Acc bit 5
  2156.       ACC.6   .equ    0E6H    ;Acc bit 6
  2157.       Acc.7   .equ    0E7H    ;Acc bit 7
  2158.       
  2159.       See the manufacturer's data sheets for more information.
  2160.       
  2161.  
  2162.       TASM - Table Driven Assembler                                Page 37  
  2163.       
  2164.       
  2165.       TASM DISTRIBUTION FILES
  2166.       
  2167.       TASM  is  distributed  in  two  different  packages  - an executable
  2168.       package and a source package.  The files  associated  with  each  of
  2169.       these are described below:
  2170.       
  2171.               EXECUTABLE PACKAGE
  2172.               ------------------------------------------------------------
  2173.               1.  TASM.EXE          - TASM Assembler, executable
  2174.               2.  TASM48.TAB        - 8048 Instruction definition table
  2175.               3.  TASM51.TAB        - 8051 Instruction definition table
  2176.               4.  TASM65.TAB        - 6502 Instruction definition table
  2177.               5.  TASM.DOC          - TASM Documentation
  2178.               6.  README            - Brief Explanation of Disk contents
  2179.       
  2180.               SOURCE PACKAGE
  2181.               ------------------------------------------------------------
  2182.               1.  TASM.EXE          - TASM Assembler, executable
  2183.               2.  TASM48.TAB        - 8048 Instruction definition table
  2184.               3.  TASM51.TAB        - 8051 Instruction definition table
  2185.               4.  TASM65.TAB        - 6502 Instruction definition table
  2186.               5.  TASM.DOC          - TASM Documentation
  2187.               6.  README            - Brief Explanation of Disk contents
  2188.       
  2189.               7.  TASM.C            - TASM mainline source code
  2190.               8.  STRLIB.C          - String library
  2191.               9.  IOLIB.C           - I/O Library
  2192.               10. MACRO.C           - Assembler directive support library
  2193.               11. CMAIN.C           - Command line parser
  2194.               12. CT.ASM            - MSDOS/C Interface module (startup)
  2195.               13. FUNC.ASM          - Assembly language functions
  2196.               14. UBYTE.H           - Header file defining unsigned types
  2197.               15. TASM.H            - Header file defining TASM constants
  2198.               16. TASMBLD.BAT       - Batch file to build TASM.EXE
  2199.       
  2200.       The  'C'  modules  can  be compiled with the Microsoft 'C' compiler,
  2201.       version 2.03  using  the  small  memory  model.  It  should  not  be
  2202.       difficult to use other 'C' compilers, however, because no library is
  2203.       needed and typical portability problems have been avoided.
  2204.       
  2205.       The  assembler  files  can  be  assembled  using the Microsoft Macro
  2206.       Assembler (MASM) or  equivalent.  The  standard  link  utility  that
  2207.       comes  with  MSDOS (Microsoft LINK) can be used to perform the link.
  2208.       The TASMBLD.BAT file demonstrates  steps  necessary  for  compiling,
  2209.       assembling and linking.
  2210.       
  2211.       
  2212.       
  2213.       
  2214.       
  2215.       
  2216.       
  2217.       
  2218.       
  2219.       
  2220.       
  2221.  
  2222.       TASM - Table Driven Assembler                                Page 38  
  2223.       
  2224.       
  2225.       PORTING TASM TO OTHER ENVIRONMENTS
  2226.       
  2227.       TASM source code is fairly portable.  We,  however, have only tested
  2228.       it in two environments,  Berkeley UNIX (BSD 4.2) and MSDOS 2.1 (UNIX
  2229.       is  a  trademark  of  AT&T,  MSDOS  is  a  trademark  of Microsoft).
  2230.       Portability is enhanced by:
  2231.       
  2232.               1.  All identifiers are unique to 6 characters.
  2233.               2.  No floating point arithmetic.
  2234.               3.  No Long (32 bit) arithmetic.
  2235.               4.  No bit fields.
  2236.               5.  Self contained code (no library routines are necessary).
  2237.       
  2238.       
  2239.       It  should  be  noted that a number of the modules that are included
  2240.       with TASM are not  necessary  in  some  other  environments  because
  2241.       identical  facilities  are  part of the standard library.  TASM does
  2242.       not use any libraries from other vendors (including the Microsoft  C
  2243.       library  that comes with the compiler that was used to compile TASM)
  2244.       to ensure  no  copyrights  are  violated.  The  modules  that  would
  2245.       generally not be needed include:
  2246.       
  2247.               1.  iolib.c     This includes read(), write(), open(),
  2248.                                   close(), sprintf(), etc.
  2249.               2.  strlib.c    This includes strcpy(), strcmp(), isdigit(),
  2250.                                   isalnum(), etc.
  2251.               3.  cmain.c     Parses command line into argc, argv format.
  2252.               4.  ct.asm      Interface between MSDOS and Microsoft C.
  2253.               5.  func.asm    Peek and poke functions.
  2254.       
  2255.       
  2256.       For example, the following command can be used to make an executable
  2257.       version of TASM for the BSD 4.2 environment:
  2258.       
  2259.               %cc -DUNIX tasm.c macro.c  -o tasm
  2260.       
  2261.       The header files tasm.h and ubyte.h should also be available.
  2262.       
  2263.       Note  that the UNIX flag is being defined on the command line.  This
  2264.       causes the following things to happen:
  2265.       
  2266.               1.   Unsigned   word   and   byte   typedefs   are   defined
  2267.                       appropriately (Microsoft C 2.03  is  nonstandard  in
  2268.                       this respect).
  2269.       
  2270.               2.  Tasm.h includes sys/file.h instead of defining  its  own
  2271.                       file open constants.
  2272.       
  2273.               3.  TASM declares a 64 Kbyte array  in  which  to  hold  the
  2274.                       assembled   opcodes   and   data.   In   the   MSDOS
  2275.                       environment a 64 Kbyte segment is  used  immediately
  2276.                       following  the stack segment to hold the opcodes and
  2277.                       data.  This is done so a small  data  model  can  be
  2278.                       used  by  the compiler (since many compilers for the
  2279.                       MSDOS environment do not have  any  other  option  -
  2280.                       done  for  portability  to other MSDOS C compilers).
  2281.  
  2282.       TASM - Table Driven Assembler                                Page 39  
  2283.       
  2284.                       In the BSD UNIX environment,  64 Kbyte arrays are no
  2285.                       problem,  and  if you are porting the code to a like
  2286.                       environment (whether UNIX or not), the UNIX flag may
  2287.                       be  useful.   This  eliminates  calls   to   several
  2288.                       assembly   language  routines  defined  in  func.asm
  2289.                       (peekb, pokeb, and getsegs).  Also,  if you are only
  2290.                       interested  in  the 8048 version,  which really only
  2291.                       needs a  4  Kbyte  memory  space,  the  local  array
  2292.                       approach  would  suffice  and eliminate the need for
  2293.                       the assembly language calls.
  2294.       
  2295.       
  2296.       For information on building TASM in the MSDOS environment,  see  the
  2297.       TASMBLD.BAT file.
  2298.       
  2299.       
  2300.       
  2301.       
  2302.       
  2303.       
  2304.       
  2305.       
  2306.       
  2307.       
  2308.       
  2309.       
  2310.       
  2311.       
  2312.       
  2313.       
  2314.       
  2315.       
  2316.       
  2317.       
  2318.       
  2319.       
  2320.       
  2321.       
  2322.       
  2323.       
  2324.       
  2325.       
  2326.       
  2327.       
  2328.       
  2329.       
  2330.       
  2331.       
  2332.       
  2333.       
  2334.       
  2335.       
  2336.       
  2337.       
  2338.       
  2339.       
  2340.       
  2341.  
  2342.       TASM - Table Driven Assembler                                Page 40  
  2343.       
  2344.       
  2345.       TASM INSTRUCTION SET TABLE DEFINITION
  2346.       
  2347.       The tables that control TASM's interpretation of the source file are
  2348.       read from a file at run time.  The table file name is determined  by
  2349.       taking  the  numeric option field specified on the TASM command line
  2350.       and appending it to the string "TASM", then a  ".TAB"  extension  is
  2351.       added.  Thus, if the following command line is entered:
  2352.       
  2353.               tasm -51  test.asm
  2354.       
  2355.       then TASM would read the table file named "TASM51.TAB".
  2356.       
  2357.       
  2358.       
  2359.       The following rules apply to the structure of the table file:
  2360.       
  2361.               1.  The  first  line  of  the  file  should contain a string
  2362.                       surrounded by double quotes that should identify the
  2363.                       version of the assembler  table.  This  string  will
  2364.                       appear at the top of each page in the list file.  It
  2365.                       should be limited to 24 characters.
  2366.       
  2367.               2.  Any  line  whose  first  character  is not alphabetic is
  2368.                       considered to be a comment and is discarded.
  2369.       
  2370.               3.  Any  line  that has an alphabetic character as the first
  2371.                       character is assumed to be an instruction definition
  2372.                       record  and  is  parsed  to   build   the   internal
  2373.                       representation  of the instruction set tables.   Six
  2374.                       fields (separated by white space) are  expected,  as
  2375.                       follows:
  2376.       
  2377.                       Field Name      Description
  2378.                       --------------------------------------------
  2379.                       INSTRUCTION     Instruction Mnemonic
  2380.                       ARGS            Argument definition
  2381.                       OPCODE          Opcode value
  2382.                       NBYTES          Number of bytes
  2383.                       MODOP           Modifier operation
  2384.                       CLASS           Instruction class
  2385.       
  2386.       
  2387.                       INSTRUCTION.  The  INSTRUCTION  field should contain
  2388.                       the string to be  used  as  the  mnemonic  for  this
  2389.                       instruction.  Upper case letters should be used (the
  2390.                       source statements are converted to upper case before
  2391.                       comparison).
  2392.       
  2393.       
  2394.                       ARGS.   The  ARGS  field  should  contain  a  string 
  2395.                       describing  the  format  of  the operand field.  All 
  2396.                       characters are taken literally except the '*'  which 
  2397.                       denotes  the  presence  of  a valid TASM expression.  
  2398.                       Multiple '*'s can be used,  but all but the last one 
  2399.                       must  be  followed  by  a  comma.  If  a  single '*' 
  2400.                       appears in the ARGS field,  then the default  action 
  2401.  
  2402.       TASM - Table Driven Assembler                                Page 41  
  2403.       
  2404.                       of  TASM  will  be  to  determine  the  value of the 
  2405.                       expression that matches the field and insert one  or 
  2406.                       two  bytes  of  it into the object file depending on 
  2407.                       the NBYTES field.  If multiple '*'s are  used,  then 
  2408.                       special  operators  (MODOP)  must  be  used  to take 
  2409.                       advantage of them (see the examples below).  An ARGS 
  2410.                       field of a pair  of  double  quotes  means  that  no 
  2411.                       arguments are expected.  
  2412.       
  2413.       
  2414.                       OPCODE.  The OPCODE field should contain the  opcode
  2415.                       value  (two  hex  digits)  for  this instruction and
  2416.                       address mode.
  2417.       
  2418.       
  2419.                       NBYTES.  The NBYTES field should specify the  number
  2420.                       of  bytes  this  instruction  is to occupy (a single
  2421.                       decimal digit).
  2422.       
  2423.       
  2424.                       MODOP.  The MODOP field determines  if  any  special
  2425.                       operations   need   to  be  performed  on  the  code
  2426.                       generated for this  instruction.  For  example,  the
  2427.                       zero-page  addressing  mode of the 6502 is a special
  2428.                       case of the absolute addressing mode, and is handled
  2429.                       by a special MODOP code (see appendix B).  The  list
  2430.                       of operators is as follows:
  2431.       
  2432.       
  2433.                       MODOP       DESCRIPTION
  2434.                       ---------------------------------------------------
  2435.                       NOTOUCH     Do nothing to instruction or args
  2436.                       JMPPAGE     Put bits 8-10 of first arg into
  2437.                                   bits 5-7 of opcode (8048 JMP)
  2438.                       ZPAGE       If arg < 256 then use zero-page (6502)
  2439.                       R1          Make arg relative to PC (single byte)
  2440.                       R2          Make arg relative to PC (two byte)
  2441.                       CREL        Combine LS bytes of first two args
  2442.                                   making the second one relative to PC
  2443.                       SWAP        Swap bytes of first arg
  2444.                       COMBINE     Combine LS bytes of first two args into
  2445.                                   first arg (arg1 -> LSB, arg2 ->MSB).
  2446.                       CSWAP       Combine LS bytes of first two args into
  2447.                                   first arg and swap.
  2448.       
  2449.                       Note  that the reason for the combining of arguments 
  2450.                       (COMBINE and CSWAP) is that TASM  assumes  that  all 
  2451.                       object  bytes  to be inserted in the object file are 
  2452.                       derived from a variable representing  the  value  of 
  2453.                       the  first  argument (argval).  If two arguments are 
  2454.                       in the  ARGS  field,  then  one  of  the  previously 
  2455.                       mentioned  MODOP`s  must  be  used.  They  have  the 
  2456.                       effect of combining the low bytes of the  first  two 
  2457.                       arguments  into the variable (argval) from which the 
  2458.                       object  code  will  be  generated.  TASM`s  argument 
  2459.                       parsing   routine  can  handle  a  large  number  of 
  2460.                       arguments,  but the code that generates  the  object 
  2461.  
  2462.       TASM - Table Driven Assembler                                Page 42  
  2463.       
  2464.                       code is less capable.  
  2465.       
  2466.                       CLASS.  The  CLASS  field is used to specify whether
  2467.                       this instruction is part of the standard instruction
  2468.                       set or a member of a set of  extended  instructions.
  2469.                       Bit 0 of this field should be set to denote a member
  2470.                       of  the standard instruction set.  Other bits can be
  2471.                       used as needed  to  establish  several  classes  (or
  2472.                       sets)   of  instructions  that  can  be  enabled  or
  2473.                       disabled via  the  '-x'  command  line  option  (see
  2474.                       section on 6502 INSTRUCTIONS AND ADDRESSING MODES).
  2475.       
  2476.       
  2477.       For  example  the  following  table   shows   possible   instruction
  2478.       definition  records,  followed  by  possible  source statements that
  2479.       would match it,  followed by the resulting object code that would be
  2480.       generated (in hex):
  2481.                                                       EXAMPLE
  2482.       INSTRUCTION DEFINITION                  SOURCE          OBJECT
  2483.       -------------------------------------------------------------------
  2484.       XYZ  *     FF  3  NOTOUCH 1             xyz 1234h       FF 34 12
  2485.       XYZ  *     FF  2  NOTOUCH 1             xyz 1234h       FF 34
  2486.       ZYX  *     FE  3  SWAP    1             zyx 1234h       FE 12 34
  2487.       ZYX  *     FE  3  R2      1             zyx $+4         FE 01 00
  2488.       ABC  *,*   FD  3  COMBINE 1             abc 45h,67h     FD 45 67
  2489.       ABC  *,*   FD  3  CSWAP   1             abc 45h,67h     FD 67 45
  2490.       ADD  A,#*  FC  2  NOTOUCH 1             add A,#'B'      FC 42
  2491.       RET  ""    FB  1  NOTOUCH 1             ret             FB
  2492.       
  2493.       See appendix B for more examples.
  2494.       
  2495.       The  order  of  the  entries for various addressing modes of a given 
  2496.       instruction is important.  Since the wild card matches anything,  it 
  2497.       is  important to specify the ARGS for the addressing modes that have 
  2498.       the  most  qualifying  characters  first.   For   example,   if   an 
  2499.       instruction  had  two  addressing  modes,   one  that  accepted  any 
  2500.       expression,  and another that required a pound sign in front  of  an 
  2501.       expression,  the  pound  sign  entry  should  go first otherwise all 
  2502.       occurrences of the instruction would match  the  more  general  ARGS 
  2503.       expression   that  it  encountered  first.   The  following  entries 
  2504.       illustrate the proper sequencing: 
  2505.       
  2506.               ADD #*  12 3 NOTOUCH 1
  2507.               ADD *   13 3 NOTOUCH 1
  2508.       
  2509.       
  2510.       
  2511.       
  2512.       
  2513.       
  2514.       
  2515.       
  2516.       
  2517.       
  2518.       
  2519.       
  2520.       
  2521.  
  2522.       TASM - Table Driven Assembler                                Page 43  
  2523.       
  2524.       
  2525.       SUMMARY
  2526.       --------------------------------------------------------------------------------------------------------------------------
  2527.       COMMAND LINE:                                               | DIRECTIVES:
  2528.         tasm -vv [-bcfhlmpxdo] source_file [obj_file [list_file]] |   #INCLUDE <filename> Read <filename> as source
  2529.                                                                   |   #DEFINE  <label> [<macro_def>] Define a macro
  2530.         -<vv>   Select version (-48, -51, or -65)                 |   #IFDEF   <label>    Assemble following if <label> DEFINEd
  2531.         -o<nn>  Specify number of obj bytes per record (hex)      |   #IFNDEF  <label>    Assemble following if <label> not DEFd
  2532.         -c      object file written as a contiguous block         |   #IF      <expr>     Assemble following if <expr> nonzero
  2533.         -d<mac> define a macro                                    |   #ELSE               Alternate block to assemble
  2534.         -f<xx>  Fill entire memory space with <xx> (hex)          |   #ENDIF              End of conditional block
  2535.         -h      Produce hex table of the assembled code           |   .ORG     <expr>     Set Instruction Pointer
  2536.         -l      Produce a label table in the listing              |   .BYTE    <expr>     Define a byte
  2537.         -m      Produce object in MOS Technology format           |   .WORD    <expr>     Define a word (lsb, msb)
  2538.         -b      Produce object in binary (.COM) format            |   .EQU     <expr>     Assign a value to label
  2539.         -p      Page the listing file                             |   .TEXT    <string>   Define bytes as ASCII characters
  2540.         -x<m>   Enable extended instruction set (m = class mask)  |   .BLOCK   <expr>     Block space reserve
  2541.         -q      Quite, disable listing file                       |   .TITLE   <string>   Set a title to appear on listing
  2542.       ------------------------------------------------------------|   .EJECT              Do Top of Form on listing
  2543.       OPERATORS:                                                  |   .LIST               Turn listing on
  2544.         Operator  Type          Description                       |   .NOLIST             Turn listing off
  2545.         __________________________________________                |   .PAGE               Turn paging on
  2546.         +        Additive       addition                          |   .NOPAGE             Turn paging off
  2547.         -                       subtraction                       |   .ADDINSTR <instdef> Add instruction
  2548.         *        Multiplicative multiplication                    |   .END                End of source code
  2549.         /                       division                          |   =        <expr>     Alternate form of EQU
  2550.         %                       modulo                            |   *=       <expr>     Alternate form of ORG
  2551.         <<                      logical shift left                |------------------------------------------------------
  2552.         >>                      logical shift right               | CONSTANTS:
  2553.         ~        Unary          bit inversion (one's complement)  |   Numeric constants: <digits><suffix>
  2554.         -                       unary negation                    |     <digits> = digit string taken from (0-9,a-f,A-F)
  2555.         =        Relational     equal                             |     <suffix> = radix indicator defined as follows:
  2556.         ==                      equal                             |
  2557.         !=                      not equal                         |     Suffix              Radix
  2558.         <                       less than                         |     ------------------------
  2559.         >                       greater than                      |     b or B               2   (or % prefix)
  2560.         <=                      less than or equal                |     o or O               8   (or @ prefix)
  2561.         >=                      greater than or equal             |     d or D (or nothing)  10
  2562.         &       Binary          binary 'and'                      |     h or H               16  (or $ prefix)
  2563.         |                       binary 'or'                       |
  2564.         ^                       binary 'exclusive or'             |   Character constants: '<char>' (printable ASCII
  2565.       Note: 16 bit values used.  Relational Ops yield 1 or 0.     |                         character surrounded by single
  2566.                                                                   |                         quotes, e.g. 'a'.
  2567.                                                                   |
  2568.       ------------------------------------------------------------|   String constants: "<characters>" (printable ASCII
  2569.       NOTES:                                                      |                      characters surrounded by double
  2570.        1. Statement format:<label> <operation> <operand> <comment>|                      quotes, e.g. "This is a string".
  2571.        2. The backslash can be used to separate multiple          |                      Used only for TEXT and TITLE.
  2572.               statements on a line (e.g. lda byte1 \ sta byte2).  |
  2573.        3. '$' or '*' represent the current Instruction Counter.   |
  2574.        4. Comments preceded by semicolon (';').                   |
  2575.        5. TASM is case insensitive for mnemonics, but not labels. |
  2576.        6. The default object file format is Intel Hex.            |
  2577.        7. For 6502 version -x3 option enables R65C02 instructions |
  2578.               and -x5 enables R65C00/21 instructions.             |
  2579.       --------------------------------------------------------------------------------------------------------------------------
  2580.       
  2581.  
  2582.       TASM - Table Driven Assembler                                Page 44  
  2583.       
  2584.       
  2585.       APPENDIX A - SAMPLE LISTING FILE
  2586.       
  2587.       The listing was generated by issuing the command:
  2588.               tasm -65 -p -l -h -f00 t.asm
  2589.       
  2590.       TASM 6502 Assembler.            t.asm                         page 1
  2591.       Speech Technology Incorporated.
  2592.       
  2593.       0001   0000             ;This is a simple example of an assembly
  2594.       0002   0000             ;include a file just for fun
  2595.       0003   0000             #include        "include.h"
  2596.       0001+  0000             ;this is just a simple include file
  2597.       0002+  0000             exit    .equ    7e00h
  2598.       0003+  0000             ;
  2599.       0004+  0000             ; That's all
  2600.       0004   0000             ;
  2601.       0005   0000             ; define two byte increment macro
  2602.       0006   0000             #define INCZ(p) ldx #p\ inc 0,x\ bne $+4\ inc 1,x
  2603.       0007   0000             ;
  2604.       0008   0000             start   .org    $0
  2605.       0009   0000             mask    .equ    $5678
  2606.       0010   0000
  2607.       0011   0000 0A          byte1   .byte   10
  2608.       0012   0001 D2 04       word1   .word   1234
  2609.       0013   0003 34 12       word2   .word   $1234
  2610.       0014   0005             ;skip past a few locations to start code
  2611.       0015   0020                     .org    $0020
  2612.       0016   0020             begin
  2613.       0017   0020             ;     let's just increment word1 the number
  2614.       0018   0020             ;     of times indicated by byte1 (use the
  2615.       0019   0020             ;     double byte increment macro INCZ).
  2616.       0020   0020             loop1
  2617.       0021   0020 A2 01               ldx #word1\ inc 0,x\ bne $+4\ inc 1,x
  2618.       0021   0022 F6 00
  2619.       0021   0024 D0 02
  2620.       0021   0026 F6 01
  2621.       0022   0028 C6 00               dec     byte1   ;decrement the count
  2622.       0023   002A D0 F4               bne     loop1   ;loop until zero
  2623.       0024   002C
  2624.       0025   002C             ; Now  let's just do some simple arithmetic
  2625.       0026   002C A5 56               lda     (mask >> 8)
  2626.       0027   002E AD 00 56            lda     (mask & 0ff00h)
  2627.       0028   0031 A5 57               lda     ((mask >> 8) & 0ffh) + word1
  2628.       0029   0033 4C 00 7E            jmp     exit
  2629.       0030   0036                     .end
  2630.       
  2631.       
  2632.       
  2633.       
  2634.       
  2635.       
  2636.       
  2637.       
  2638.       
  2639.       
  2640.       
  2641.  
  2642.       TASM - Table Driven Assembler                                Page 45  
  2643.       
  2644.       
  2645.       
  2646.       Label        Value      Label        Value      Label        Value
  2647.       ------------------      ------------------      ------------------
  2648.       exit          7E00      start         0000      mask          5678
  2649.       byte1         0000      word1         0001      word2         0003
  2650.       begin         0020      loop1         0020
  2651.       
  2652.       ADDR  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
  2653.       -----------------------------------------------------
  2654.       0000  0A D2 04 34 12 00 00 00 00 00 00 00 00 00 00 00
  2655.       0010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  2656.       0020  A2 01 F6 00 D0 02 F6 01 C6 00 D0 F4 A5 56 AD 00
  2657.       0030  56 A5 57 4C 00 7E 00 00 00 00 00 00 00 00 00 00
  2658.       
  2659.       tasm: Number of errors = 0
  2660.       
  2661.       
  2662.       
  2663.       
  2664.       
  2665.       
  2666.       
  2667.       
  2668.       
  2669.       
  2670.       
  2671.       
  2672.       
  2673.       
  2674.       
  2675.       
  2676.       
  2677.       
  2678.       
  2679.       
  2680.       
  2681.       
  2682.       
  2683.       
  2684.       
  2685.       
  2686.       
  2687.       
  2688.       
  2689.       
  2690.       
  2691.       
  2692.       
  2693.       
  2694.       
  2695.       
  2696.       
  2697.       
  2698.       
  2699.       
  2700.       
  2701.  
  2702.       TASM - Table Driven Assembler                                Page 46  
  2703.       
  2704.       
  2705.       APPENDIX B - SAMPLE INSTRUCTION DEFINITION TABLE (TASM65.TAB)
  2706.       
  2707.       "TASM 6502 Assembler.    "
  2708.       /* This is the instruction set definition table
  2709.       /*   for the 6502 version of TASM.
  2710.       /*      Thomas N. Anderson, Speech Technology Incorporated, Feb 1986.
  2711.       /*  First line of this file is a banner that will appear at the
  2712.       /*  top of each page of the TASM listing file (not the same as
  2713.       /*  the TITLE).  Should be limited to 24 characters.
  2714.       /*  Any other line that does not start with an upper case letter is
  2715.       /*  ignored.
  2716.       /*  See TASM manual for info on table structure.
  2717.       /*  Note that there are two classes of extended instructions beyond
  2718.       /*    the standard set.  The classes are assigned bits as follows:
  2719.       /*      bit 0 = standard set
  2720.       /*      bit 1 = extended instructions for R65C02
  2721.       /*      bit 2 = extended instructions for R65C00/21
  2722.       /*
  2723.       /*INSTR ARGS OPCODE BYTES MOD CLASS */
  2724.       /*----------------------------------*/
  2725.       ADC  #*     69    2  NOP 1
  2726.       ADC  (*,X)  61    2  NOP 1
  2727.       ADC  (*),Y  71    2  NOP 1
  2728.       ADC  (*)    72    2  NOP 2   /* R65C02 */
  2729.       ADC  *,X    7D    3  ZP  1
  2730.       ADC  *,Y    79    3  NOP 1
  2731.       ADC  *      6D    3  ZP  1
  2732.       
  2733.       AND  #*     29    2  NOP 1
  2734.       AND  (*,X)  21    2  NOP 1
  2735.       AND  (*),Y  31    2  NOP 1
  2736.       AND  (*)    32    2  NOP 2   /* R65C02 */
  2737.       AND  *,X    3D    3  ZP  1
  2738.       AND  *,Y    39    3  NOP 1
  2739.       AND  *      2D    3  ZP  1
  2740.       
  2741.       ASL  A      0A    1  NOP 1
  2742.       ASL  *,X    1E    3  ZP  1
  2743.       ASL  *      0E    3  ZP  1
  2744.       
  2745.       BCC  *      90    2  R1  1
  2746.       BCS  *      B0    2  R1  1
  2747.       BEQ  *      F0    2  R1  1
  2748.       BNE  *      D0    2  R1  1
  2749.       BMI  *      30    2  R1  1
  2750.       BPL  *      10    2  R1  1
  2751.       BVC  *      50    2  R1  1
  2752.       BVS  *      70    2  R1  1
  2753.       
  2754.       BIT  #*     89    2  NOP 2
  2755.       BIT  *,X    3C    3  ZP  2
  2756.       BIT  *      2C    3  ZP  1
  2757.       
  2758.       BRK  ""     00    1  NOP 1
  2759.       
  2760.       CLC  ""     18    1  NOP 1
  2761.  
  2762.       TASM - Table Driven Assembler                                Page 47  
  2763.       
  2764.       CLD  ""     D8    1  NOP 1
  2765.       CLI  ""     58    1  NOP 1
  2766.       CLV  ""     B8    1  NOP 1
  2767.       
  2768.       CMP  #*     C9    2  NOP 1
  2769.       CMP  (*,X)  C1    2  NOP 1
  2770.       CMP  (*),Y  D1    2  NOP 1
  2771.       CMP  (*)    D2    2  NOP 2
  2772.       CMP  *,X    DD    3  ZP  1
  2773.       CMP  *,Y    D9    3  NOP 1
  2774.       CMP  *      CD    3  ZP  1
  2775.       
  2776.       CPX  #*     E0    2  NOP 1
  2777.       CPX  *      EC    3  ZP  1
  2778.       
  2779.       CPY  #*     C0    2  NOP 1
  2780.       CPY  *      CC    3  ZP  1
  2781.       
  2782.       DEC  A      3A    3  NOP 2
  2783.       DEC  *,X    DE    3  ZP  1
  2784.       DEC  *      CE    3  ZP  1
  2785.       
  2786.       DEX  ""     CA    1  NOP 1
  2787.       DEY  ""     88    1  NOP 1
  2788.       
  2789.       EOR  #*     49    2  NOP 1
  2790.       EOR  (*,X)  41    2  NOP 1
  2791.       EOR  (*),Y  51    2  NOP 1
  2792.       EOR  (*)    52    2  NOP 2
  2793.       EOR  *,X    5D    3  ZP  1
  2794.       EOR  *,Y    59    3  NOP 1
  2795.       EOR  *      4D    3  ZP  1
  2796.       
  2797.       INC  A      1A    3  NOP 2
  2798.       INC  *,X    FE    3  ZP  1
  2799.       INC  *      EE    3  ZP  1
  2800.       
  2801.       INX  ""     E8    1  NOP 1
  2802.       INY  ""     C8    1  NOP 1
  2803.       
  2804.       JMP  (*,X)  7C    3  NOP 2
  2805.       JMP  (*)    6C    3  NOP 1
  2806.       JMP  *      4C    3  NOP 1
  2807.       
  2808.       JSR  *      20    3  NOP 1
  2809.       
  2810.       LDA  #*     A9    2  NOP 1
  2811.       LDA  (*,X)  A1    2  NOP 1
  2812.       LDA  (*),Y  B1    2  NOP 1
  2813.       LDA  (*)    B2    2  NOP 2
  2814.       LDA  *,X    BD    3  ZP  1
  2815.       LDA  *,Y    B9    3  NOP 1
  2816.       LDA  *      AD    3  ZP  1
  2817.       
  2818.       LDX  #*     A2    2  NOP 1
  2819.       LDX  *,Y    BE    3  ZP  1
  2820.       LDX  *      AE    3  ZP  1
  2821.  
  2822.       TASM - Table Driven Assembler                                Page 48  
  2823.       
  2824.       
  2825.       LDY  #*     A0    2  NOP 1
  2826.       LDY  *,X    BC    3  ZP  1
  2827.       LDY  *      AC    3  ZP  1
  2828.       
  2829.       LSR  A      4A    1  NOP 1
  2830.       LSR  *,X    5E    3  ZP  1
  2831.       LSR  *      4E    3  ZP  1
  2832.       
  2833.       NOP  ""     EA    1  NOP 1
  2834.       
  2835.       ORA  #*     09    2  NOP 1
  2836.       ORA  (*,X)  01    2  NOP 1
  2837.       ORA  (*),Y  11    2  NOP 1
  2838.       ORA  (*)    12    2  NOP 2
  2839.       ORA  *,X    1D    3  ZP  1
  2840.       ORA  *,Y    19    3  NOP 1
  2841.       ORA  *      0D    3  ZP  1
  2842.       
  2843.       PHA  ""     48    1  NOP 1
  2844.       PHP  ""     08    1  NOP 1
  2845.       PLA  ""     68    1  NOP 1
  2846.       PLP  ""     28    1  NOP 1
  2847.       
  2848.       ROL  A      2A    1  NOP 1
  2849.       ROL  *,X    3E    3  ZP  1
  2850.       ROL  *      2E    3  ZP  1
  2851.       
  2852.       ROR  A      6A    1  NOP 1
  2853.       ROR  *,X    7E    3  ZP  1
  2854.       ROR  *      6E    3  ZP  1
  2855.       
  2856.       RTI  ""     40    1  NOP 1
  2857.       RTS  ""     60    1  NOP 1
  2858.       
  2859.       SBC  #*     E9    2  NOP 1
  2860.       SBC  (*,X)  E1    2  NOP 1
  2861.       SBC  (*),Y  F1    2  NOP 1
  2862.       SBC  (*)    F2    2  NOP 2
  2863.       SBC  *,X    FD    3  ZP  1
  2864.       SBC  *,Y    F9    3  NOP 1
  2865.       SBC  *      ED    3  ZP  1
  2866.       
  2867.       SEC  ""     38    1  NOP 1
  2868.       SED  ""     F8    1  NOP 1
  2869.       SEI  ""     78    1  NOP 1
  2870.       
  2871.       STA  (*,X)  81    2  NOP 1
  2872.       STA  (*),Y  91    2  NOP 1
  2873.       STA  (*)    92    2  NOP 2
  2874.       STA  *,X    9D    3  ZP  1
  2875.       STA  *,Y    99    3  NOP 1
  2876.       STA  *      8D    3  ZP  1
  2877.       
  2878.       STX  *,Y    96    2  ZP  1
  2879.       STX  *      8E    3  ZP  1
  2880.       
  2881.  
  2882.       TASM - Table Driven Assembler                                Page 49  
  2883.       
  2884.       STY  *,X    94    2  NOP 1
  2885.       STY  *      8C    3  ZP  1
  2886.       
  2887.       TAX  ""     AA    1  NOP 1
  2888.       TAY  ""     A8    1  NOP 1
  2889.       TSX  ""     BA    1  NOP 1
  2890.       TXA  ""     8A    1  NOP 1
  2891.       TXS  ""     9A    1  NOP 1
  2892.       TYA  ""     98    1  NOP 1
  2893.       
  2894.       /* Here are the extended instructions that are totally new */
  2895.       
  2896.       BRA  *      80    2  R1  6
  2897.       
  2898.       BBR0 *,*    0f    3  CR  6
  2899.       BBR1 *,*    1f    3  CR  6
  2900.       BBR2 *,*    2f    3  CR  6
  2901.       BBR3 *,*    3f    3  CR  6
  2902.       BBR4 *,*    4f    3  CR  6
  2903.       BBR5 *,*    5f    3  CR  6
  2904.       BBR6 *,*    6f    3  CR  6
  2905.       BBR7 *,*    7f    3  CR  6
  2906.       
  2907.       BBS0 *,*    8f    3  CR  6
  2908.       BBS1 *,*    9f    3  CR  6
  2909.       BBS2 *,*    af    3  CR  6
  2910.       BBS3 *,*    bf    3  CR  6
  2911.       BBS4 *,*    cf    3  CR  6
  2912.       BBS5 *,*    df    3  CR  6
  2913.       BBS6 *,*    ef    3  CR  6
  2914.       BBS7 *,*    ff    3  CR  6
  2915.       
  2916.       MUL  ""     02    1  NOP 4  /* R65C00/21 only*/
  2917.       
  2918.       PHX  ""     da    1  NOP 6
  2919.       PHY  ""     5a    1  NOP 6
  2920.       PLX  ""     fa    1  NOP 6
  2921.       PLY  ""     7a    1  NOP 6
  2922.       
  2923.       RMB0 *      07    2  NOP 6
  2924.       RMB1 *      17    2  NOP 6
  2925.       RMB2 *      27    2  NOP 6
  2926.       RMB3 *      37    2  NOP 6
  2927.       RMB4 *      47    2  NOP 6
  2928.       RMB5 *      57    2  NOP 6
  2929.       RMB6 *      67    2  NOP 6
  2930.       RMB7 *      77    2  NOP 6
  2931.       
  2932.       SMB0 *      87    2  NOP 6
  2933.       SMB1 *      97    2  NOP 6
  2934.       SMB2 *      a7    2  NOP 6
  2935.       SMB3 *      b7    2  NOP 6
  2936.       SMB4 *      c7    2  NOP 6
  2937.       SMB5 *      d7    2  NOP 6
  2938.       SMB6 *      e7    2  NOP 6
  2939.       SMB7 *      f7    2  NOP 6
  2940.       
  2941.  
  2942.       TASM - Table Driven Assembler                                Page 50  
  2943.       
  2944.       /* The following extended instructions are available on the
  2945.               R65C02 but not the R65C00/21 */
  2946.       
  2947.       STZ  *,X    9e    3  ZP  2
  2948.       STZ  *      9c    3  ZP  2
  2949.       
  2950.       TRB  *      1c    3  ZP  2
  2951.       TSB  *      0c    3  ZP  2
  2952.       
  2953.       
  2954.       
  2955.       
  2956.       
  2957.       
  2958.       
  2959.       
  2960.       
  2961.       
  2962.       
  2963.       
  2964.       
  2965.       
  2966.       
  2967.       
  2968.       
  2969.       
  2970.       
  2971.       
  2972.       
  2973.       
  2974.       
  2975.       
  2976.       
  2977.       
  2978.       
  2979.       
  2980.       
  2981.       
  2982.       
  2983.       
  2984.       
  2985.       
  2986.       
  2987.       
  2988.       
  2989.       
  2990.       
  2991.       
  2992.       
  2993.       
  2994.       
  2995.       
  2996.       
  2997.       
  2998.       
  2999.       
  3000.       
  3001.  
  3002.       TASM - Table Driven Assembler                                Page 51  
  3003.       
  3004.       
  3005.       APPENDIX C - ORDERING INFORMATION
  3006.       
  3007.       TASM  is  distributed as shareware.  If you find it useful,  you are 
  3008.       encouraged to become a registered  user.  Registered  users  receive 
  3009.       the following benifits: 
  3010.                   
  3011.               1.  The recent version of TASM.
  3012.               2.  TASM source code (in C).
  3013.               3.  Bound TASM manual.
  3014.               4.  Knowledge that they are supporting  the  development  of 
  3015.                       useful but inexpensive software.  
  3016.       
  3017.       DESCRIPTION                     UNIT PRICE      QUANTITY      PRICE
  3018.       --------------------------------------------------------------------
  3019.       
  3020.       TASM Registration                    30.00      ________     _______
  3021.       
  3022.       TASM User's Manual (included above)  10.00      ________     _______
  3023.       
  3024.       
  3025.       Subtotal                                                     _______
  3026.       
  3027.       
  3028.       Tax (Washington state residents add 7.9%)                    _______
  3029.       
  3030.       
  3031.       TOTAL (post paid)                                            _______
  3032.       
  3033.       
  3034.       
  3035.       Shipping Address:
  3036.       
  3037.       ______________________________________________
  3038.       
  3039.       ______________________________________________
  3040.       
  3041.       ______________________________________________
  3042.       
  3043.       
  3044.       
  3045.       Send check or money order (no credit cards) to:
  3046.       
  3047.                       Speech Technology Incorporated
  3048.                       16321 176th Avenue NE
  3049.                       Woodinville, WA  98072
  3050.       
  3051.       
  3052.       
  3053.       
  3054.       
  3055.       
  3056.       
  3057.       
  3058.       
  3059.       
  3060.       
  3061.